The seven-time Ballon d'Or winner curled in from the edge of the area after just 81 seconds following slack defending by the Socceroos. In front of a crowd of more than 50,000 adoring fans, Messi nearly notched a rapid second but lashed into the side netting from a tight angle.
Australia weathered the early storm and nearly equalised when attacker Mitchell Duke forced Argentina goalkeeper Emiliano Martinez to tip a close-range shot onto the post.
Messi and fellow Argentina veteran Angel di Maria both drew saves from Australia stopper Mat Ryan at the start of the second half. And the world champions eventually made their pressure count when German Pezzella headed in a cross to make it 2-0 in the 68th minute. Manchester City forward Julian Alvarez again stretched Ryan as Argentina saw out victory in the sultry summer heat.
Messi is idolised in football-mad China, whose underperforming national team and struggling domestic league are chronic sources of disappointment. Midway through the second half, a young-looking fan wearing an Argentina shirt invaded the pitch and briefly embraced Messi before being hauled away by security guards.
Thousands greeted the Argentina captain's every touch with roars of anticipation that built to a crescendo when he put his team into their quick-fire lead. They had braved afternoon temperatures of nearly 40 degrees Celsius to gather at Beijing's newly renovated Workers' Stadium a full three hours before the 8 pm (1200 GMT) kick-off.
Many had donned replica shirts bearing Messi's name, while others wore blue-and-white face paint and waved miniature Argentina flags. Messi has kept a low profile, save for some commercial engagements in which he confirmed the 2022 World Cup was probably his last.
But the local excitement around the Argentine legend ratcheted up in recent days as the sell-out match drew nearer. Hundreds of fans massed outside the team's luxury hotel and lined heavily guarded streets in the hope of catching a glimpse of their hero.
Messi made waves last week when he revealed he would join MLS side Inter Miami after the end of his two-year deal with Paris Saint-Germain.
Thursday's match was a re-run of the last-16 clash between Argentina and Australia at last winter's World Cup in Qatar. On that occasion, Messi scored a goal and tormented the Socceroos' defence as the Albiceleste won 2-1.
Argentina went on to win the World Cup for the first time in 36 years. The South Americans will round off their Asian tour on Monday when they play another friendly against Indonesia in Jakarta.
June 15, 2023