Teenage striker Ansu Fati got a late winner as Barcelona survived a scare to beat Dwight Yorke's A-League All Stars in a 3-2 thriller in front of 70,000 fans in Sydney on Wednesday.
The Catalan giants only arrived in Australia on Tuesday morning on a whistlestop 48-hour visit, barely a day after completing their league season with a 2-0 loss to Villarreal, which saw them finish 13 points adrift of champions Real Madrid.
They showed few effects from the long trip to turn on the style for a noisy pro-Barca crowd, dominating the first half and going into the break 1-0 ahead after French striker Ousmane Dembele clinically finished in the 34th minute.
But the All Stars stunned them with two goals in eight second-half minutes, before Xavi Hernandez's side rallied to retake control with strikes from Adama Traore and Fati.
"Amazing atmosphere, five goals today, they played really well, I have to congratulate them," said coach Xavi.
"I think we played a very serious 90 minutes, I think we played really well. We conceded two goals, this is football, and then we came back so a very good test for us. I'm very proud."
After a rare trophy-less season, Xavi brought a strong squad and a host of top names started including captain Sergio Busquets, veteran Dani Alves, and the unsettled Dembele, who may have played his last game for the club.
It was always going to be a tough task for Yorke's hastily convened team, and with the former Manchester United striker on the sidelines for his first major coaching job.
"To see the fans, that was incredible," said Yorke. "It was a great performance by the lads, I am so pleased.
"Some of the boys surprised me considering we only had two days together in preparation. To put on a show like this, I couldn't be more proud."
Both sides had early chances with Barca teenager Alejandro Balde testing goalkeeper Filip Kurto at the near post in the sixth minute as the visitors quickly settled into a free-flowing rhythm.
Dembele went close and Gavi should have done better when Alves found him with a cross as the chances began piling up.
The breakthrough finally came with Gavi feeding Dembele after intercepting a pass and the Frenchman drilling the ball into the right-hand corner.
But the All Stars came out firing in the second half.
Reno Piscopo bundled the ball into the net two minutes after the restart, and they caught Barcelona napping again six minutes later with a counter-attack that Adama Traore -- who shares the same name as the Barca winger -- finished with a tap-in.
Rattled, the Spaniards reset and Barcelona's Traore made it 2-2 in the 72nd minute with a vicious shot that was saved but trickled over the line.
Fati got the winner five minutes later, curling the ball into the net after good work from Antonio Aranda. The All Stars nearly ruined the party, Garang Kuol rattling the post with three minutes left.