RIO DE JANEIRO — Carmelo Anthony and Kyrie Irving had the answers in the first test for the U.S. Olympic men’s basketball team.

Anthony scored 31 points on the night he became the U.S. men’s Olympic career scoring leader, combining with Irving for all the Americans’ baskets in the fourth quarter of a 98-88 victory over Australia on Wednesday night.

Irving — born in Australia — added 19 points, including a three-pointer with 1:35 left after Australia had closed within four.

A team that won its first two games by a combined 101 points could never get a comfortable lead — and for a while couldn’t get one at all. The Australians, with big bodies inside, quality point guards to counter the American pressure and a wealth of NBA championship experience, stood toe to toe with the team that had blown them out of the last two Olympics in the quarterfinals.

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

But Anthony, the most experienced U.S. player, the first male to play in four Olympics, steadied the Americans in the first competitive game most of this new team had never experienced.

Kevin Durant capped off the scoring with two free throws, making him the only other player than Irving or Anthony to score in the period.

The American, who had barely broken a sweat in Brazil, trailed early in the fourth quarter before Anthony hit a flurry of three-pointers to put the Americans on top.

Patty Mills scored 30 points for Australia.

After blowouts of China and Venezuela to open the tournament, the Americans trailed 72-70 with about 9 minutes left. Anthony scored to tie it, hit a 3-pointer to give the Americans the lead for good, and then hit a couple more 3s that pushed it to 83-76.

The team staying on a luxury cruise ship could never relax until scoring the final five points in the last 27 seconds on free throws, with Irving hitting the first three.

The Americans were so carefree in their opener that reserves Jimmy Butler played rock, paper, scissors to determine who would shoot a free throw realized it was in a fight in this one.

An enraged coach Mike Krzyzewski screamed at an official after Andrew Bogut’s hard foul on Irving just in front of the U.S. bench in the third quarter, his face looking as red as the shirts the coaching staff wore.

Bogut finished with 15 points for the Australians, who talked confidently of their chances in these Olympics. They have never won a medal but four of their players own NBA rings, and with smart passing and rugged rebounding, nearly became the first team to knock off the Americans in the Olympics since Krzyzewski took over in 2005.

“We have a pretty gritty group that’s pretty tough and we battled all night,” Bogut said.

Australia had opened the Olympics with impressive victories over France and Serbia, both ranked among the top six in the world. Then the Aussies gave the team ranked No. 1 all it could handle.

The Americans clinched a spot in the medal round, though that was never going to be in doubt.

This game, though, was.

It was the second straight game the Americans were tied after one quarter. They quickly blew away Venezuela after it was 18-all after one Saturday, but the only second-quarter surge in this one was made by Australians.

They used a 15-3 burst to make it 46-39, and Krzyzewski actually needed a timeout to calm his team that by then can usually make its postgame plans.

Anthony moved past LeBron James as the U.S. career leader in Olympic scoring and did it quickly, using a hot start to make up the 11-point advantage James had entering the game.

But no other U.S. players had much going, with Durant going 2-for-10 in the first half and Irving 2 for 7.

Irving once considered playing for Australia, where he was born while his father was playing there professionally. Krzyzewski told him he could someday have a chance to play for the U.S., and the Americans were lucky for that decision.

He exchanged a pregame hug with Matthew Dellavedova, his former backup in Cleveland, but things didn’t stay nice for long. The Aussies hit hard and the Americans hit back, with Paul George getting a technical foul for a shot at Dellavedova.

It was a welcome test for the Americans, who have been so dominant under Krzyzewski that it sometimes seems the U.S. players are the only ones who don’t make a gold medal sound assured.

They’ve said it won’t come easily.

Now they’ve finally had a game that wasn’t.

France rallies to edge Serbia

Tony Parker made a jumper with 31 seconds remaining as France rallied down the stretch after blowing a huge early lead to beat Serbia, 76-75.

The French led by 16 in the first quarter, then had to climb back from a 75-70 deficit by scoring the final six points of the game.

Nando de Colo scored the first four of those points and finished with 22 to lead France, which has won two in a row after dropping its Olympic opener. Boris Diaw had 11 points, nine rebounds and nine assists.

Miroslav Raduljica scored 16 points for Serbia (1-2), which fell into a 20-4 hole in front of top-ranked tennis player Novak Djokovic, who watched his home country after he was eliminated in singles earlier in the Olympics.

The Serbians led by seven early in the fourth quarter, but dropped their second straight.

Carmelo Anthony is now the leading all-time scorer for the United States in Olympic men’s basketball:

Player Total Points

Carmelo Anthony 293

LeBron James 273

David Robinson 270

Michael Jordan 256

More Olympics

Newsday LogoSUBSCRIBEUnlimited Digital AccessOnly 25¢for 5 months
ACT NOWSALE ENDS SOON | CANCEL ANYTIME