MELBOURNE, Australia — The World Cup is a week away, and the United States is no lock for gold.

Australia delivered that message to the world on Saturday.

For the first time in nearly 13 years, a U.S. roster of NBA players played an international game — and lost.

Patty Mills scored 30 points, and Australia rallied from a 10-point deficit in the second half to stun the Americans 98-94 and snap a 78-game U.S. winning streak that started with the bronze-medal game at the 2006 world championships.

"They wanted it more than us tonight," U.S. guard Kemba Walker said. "Lesson learned for us."

It was the first loss for the U.S. in a major international tournament or exhibition since the 2006 world championship semifinals against Greece.

The Americans won the bronze there, then were unbeaten through the cycles for the 2007 FIBA Americas, 2008 Olympics, 2010 World Cup, 2012 Olympics, 2014 World Cup and 2016 Olympics.

Add all that up, along with wins over Spain and Australia with this team, and it was a 78-game winning streak for the U.S. — the longest in program history.

And it's now over.

"It was awesome," Mills said.

Australia had never beaten the Americans, and the U.S. national team had been 30-0 all-time in Australia.

"Some of it is expected with a new group that's trying to learn about each other and learn a system," U.S. coach Gregg Popovich said. "So it's not surprising. But the Aussies gave us a great lesson as far as where we want to be and how you have to play in this kind of a competition."

A World Cup where Serbia has already made very clear it expects to win gold, where NBA MVP Giannis Antetokounmpo will lead Greece, where France figures to have a medal shot and now with the Australians absolutely knowing they can beat the U.S., will begin next week with no shortage of realistic title hopefuls.

USA Basketball is No. 1 in FIBA's world rankings, but so far in the run-up to this World Cup — with most of the top NBA stars deciding to not play this summer — the Americans have not looked like a lock for more gold.

They beat Spain by nine in Anaheim, California on Aug. 16, needed a big second half to defeat Australia by 16 on Thursday, and then let a sizable second-half lead slip away Saturday.

"Obviously, this was a great step for us," Australia guard Joe Ingles said.

Mills plays for San Antonio, so ordinarily Popovich — the longtime Spurs coach — would enjoy seeing what the veteran guard did down the stretch. Mills scored Australia's last 10 points, doing it all from banking in 3-pointers to slicing through for a layup that put the hosts up by six with 1:50 remaining.

"As I told you all after the last game, Patty's a pain," Popovich said.

Walker scored 22 points for the U.S., and Harrison Barnes had 20. Donovan Mitchell's 3-pointer with 1:05 left got the U.S. within 97-94, the Americans forced a stop on the ensuing possession and had two chances to tie — but Mitchell's 3-pointer was off, Joe Harris missed a corner 3 a few seconds later and Mills iced the game with a free throw.

Aron Baynes left the floor with his head back, screaming in celebration as he slapped hands with delirious countrymen. Ingles and Andrew Bogut grabbed their kids and brought them on the floor for a look.

Bogut scored 16 points, Ingles had 15 and Baynes scored 13 for the Australians.

Baynes powered in for a score that put Australia up 82-76 with 8:25 remaining, just before Barnes answered with a three-point play for the U.S. to start an 8-0 run that put the Americans back on top. There were four lead changes in the final quarter, the last coming when Ingles made a step-back 3 with 3:35 left for an 88-87 lead.

Mills did the rest.