Messi notches up World Cup goals record to take Argentina into knockout stages
The 38-year-old, who is playing at a sixth tournament, clocked up his 17th and 18th strikes during the game against Austria at the Dallas Stadium.
His first chance to pass the 16 goals of the Germany striker Miroslav Klose ended in failure.
He fluffed a penalty that was awarded after Lautaro Martinez was felled in the area three minutes into the match.
But Messi redeemed himself on 38 minutes.
Scotland fans work their World Cup magic on Boston
Argentina broke in a counterattack and after Alexis Mac Allister's surge down the left wing, he slid the ball into the Austria penalty area and Messi guided it past the Austria goalkeeper Alexander Schlager.
His second was rammed home through a thicket of Austrian defenders in second half stoppage.
Argentina reach knockout rounds
The victory took Argentina into the last 32 knockout stages from Group J.
Austria will have a final chance to move into the knockout rounds when they take on Algeria in Kansas City on 26 June while Argentina face debutants Jordan.
On Monday afternoon, France skipper Kylian Mbappé will have the chance to close in on Messi's record.
The 27-year-old boasts 14 strikes in three World Cups and will lead his side out against Iraq in Philadelphia.