Messi marked his 1,000th senior appearance with the opening goal and Julian Alvarez put them in control by making it 2-0 early in the second half.
Craig Goodwin's deflected shot gave Australia a lifeline, but Argentina held firm in front of their army of fans, who heavily outnumbered Australia's supporters and created an electric atmosphere at the Ahmad Bin Ali Stadium.
Messi, whose side now face the Netherlands in the last eight on Friday, said: "These are amazing feelings. I'm really happy to share this beautiful moment, these happy moments with them all.
"The effort they are making to be here with us in every single match. I know how much they enjoy it back in Argentina.
"The whole of Argentina would like to be here, but it's not possible. I think there's this bond that we have, this union, which is something beautiful.
"It's unbelievable what they transmit, the passion, their energy, their joy and we're very thankful. It's unbelievable."
Argentina controlled large parts of the match but were grateful for a superb last-ditch tackle from defender Lisandro Martinez to deny Australia's Aziz Behich.
They also owed victory to a crucial save from Emiliano Martinez in the closing moments of added time to keep out an effort from Australia's teenage substitute Garang Kuol.
Messi added: "I'm very happy for taking another step forward, achieving another objective. It was a very difficult match, we knew it was going to be this way.
"We knew it was going to be a very physical match and they were very strong.
"We had a setback with their goal, but that's the World Cup for you. Matches are always difficult and what's important is that you win."
Australia had qualified for the last 16 after beating both Tunisia and Denmark in their group after an opening defeat to France.
Head coach Graham Arnold spoke of his pride in his players' achievements but could not hide his disappointment at the Socceroos' exit.
Arnold said: "I've just said to the boys I couldn't be more proud of them for their effort, everything they gave for me and the nation.
"I really hope that Australia is very proud of these players. They did a fantastic job.
"I just thank them for all the effort they put in during the whole campaign, and my staff.
"It's all about making the nation proud and I'm pretty sure we did that."
Arnold described Messi as "remarkable" and "one of the greatest ever" and urged the Australian government to back his country's football team by building a centre of excellence.
But the 59-year-old said for him it had not been enough to reach the knock-out stages.
He added: "It's probably me, the way I am. Even though we've been successful, I feel like we've failed because I wanted to win so badly for the nation and the game in Australia.
"Making the last 16 wasn't enough, I wanted more. But that's just me. A lot of other people may be happy with it, but that's just the way I am."