RIO DE JANEIRO — Until Wednesday night, life in Rio was pretty good for the U.S. men’s basketball team.

They stayed on a luxury ship and cruised past a couple of badly outmatched opponents. They played tourist at the Christ the Redeemer statue and went on a field trip to watch Michael Phelps win yet another gold medal.

Then an Australian team with a little pedigree of its own served notice that maybe the Olympic gold medal isn’t such a foregone conclusion after all.

Banged about and taken out of their game, the U.S. had to rally in the fourth quarter to salvage a 98-88 win that was even closer than the score indicated. Sheer talent – and some timely 3-pointers from Carmelo Anthony – saved the Americans, but the Boomers from Down Under exposed some weaknesses even if they were not able to get the final job done.

The look of relief on the faces of some U.S. players told the story as well as anything.

“It got real,” Paul George said. “It definitely got real.”

This was supposed to be another romp for the collection of NBA stars that is the U.S. Olympic team. Australia is good – starting five NBA players of its own – but no one expected it to be terribly close.

That included the bookies in Las Vegas, who installed the U.S. as a 27.5-point favorite.

What the bookies didn’t realize was this wasn’t just another opponent. This was an Australian team confident in its own abilities, that has played together in various incarnations for years.

They battled for rebounds, fought over loose balls. They played hard and physical, refusing to give any possession away.

Mostly, though, they played like they belonged on the same court as the U.S. players.

“I think it’s the Australian culture,” said Joe Ingles, whose day job is playing for the Utah Jazz. “We’re not afraid of anyone. We’re not going to back down to anyone. We’re going to play the same way if it’s the top team or a low-ranked team.”

Andrew Bogut had warned his teammates not to fall into the trap of paying too much respect to the Americans. That’s hard for most teams to keep from doing, even though the U.S. is full of new players and missing past Olympians like LeBron James and Kobe Bryant.

But once things got physical, it was anyone’s game. The Australians led by five at the half and still clung to a two-point lead early in the fourth quarter before Anthony and Kyrie Irving combined to turn the tide.

“He was special tonight,” George said of Anthony, the four-time Olympian who scored 31 points. “He’s the reason we won tonight.”

The U.S. wouldn’t have been eliminated had it somehow lost, but there is a certain pride factor when it comes to U.S. Olympic basketball teams. They’ve won two gold medals and 19 straight Olympic games after the culture of the program was changed by USA Basketball managing director Jerry Colangelo in the wake of the Olympic debacle of 2004 and the loss in the 2006 world championships.

Colangelo was watching courtside as the team he built on the theory that chemistry is just as important as talent struggled to contain Australia defensively and was taken out of its offensive flow by the aggressive play of the Australians.

“There were only two possible scenarios after the first half tonight,” Colangelo said. “One is the streak is over. The second is that they’re not invincible because we had a close game.”

Thanks to Anthony and Irving, who combined for all but the last two points of the fourth quarter for the Americans, the second scenario was the one that played out. Afterward, almost everyone connected to the U.S. program tried to take a positive out of it, saying a close game will prove good for the team as it chases the gold.

“It’s pretty obvious why it’s good for us,” said Coach Mike Krzyzewski, who screamed at an official after Bogut’s hard foul on Irving in the third quarter. “You beat one of the best teams in the tournament. You beat a team that’s going to vie for a gold medal. You beat a team that was undefeated and has played together for years, a really good basketball team, so I don’t know how that could not be good for us.”

It was good for Australia, too, though they had to wonder if anyone can beat the U.S. after just falling short in their best effort. Asked if the Americans could be beaten, longtime NBA player and assistant Australian coach Luc Longley didn’t exactly offer a lot of hope.

“Not tonight,” he said. “We rolled all our dice tonight and couldn’t beat them.”