Lionel Messi produced a masterclass with two goals and an assist as he made history in Argentina's 4-1 victory over Bolivia at the Copa America.

Messi became Argentina's all-time record appearances holder after surpassing former team-mate Javier Mascherano with his 148th international cap in Cuiaba on Monday.

On the field, Messi was in magical form as he scored twice to take his internationally tally to 75, while creating the opener in a devastating first-half display in Argentina's final Group A fixture.

Messi somehow scooped the ball to Alejandro Gomez, who finished on the volley in the sixth minute, before the six-time Ballon d'Or winner stepped up to covert a 33rd-minute penalty and then beat Carlos Lampe with a superb lob nine minutes later.

Erwin Saavedra pulled a goal back for Bolivia in the 60th minute but Lautaro Martinez came off the bench and restored the three-goal advantage minutes later as Argentina sealed top spot to set up a quarter-final showdown against Ecuador.

Argentina were in control against a Bolivia team already eliminated, forcing a superb double-save from goalkeeper Lampe, who showed amazing agility to thwart Sergio Aguero and Angel Correa in the third minute.

Messi took centre stage as Argentina broke the deadlock – the superstar captain providing a highlight moment with a memorable assist as he had his back towards goal while teeing up in-form team-mate Gomez.

Bolivia's Diego Bejarano was penalised for a foul on Gomez inside the box after the half-hour mark and Messi made no mistake with the spot-kick.

After Franco Armani was called into action following a long-range effort from Jeyson Chura, Messi put Argentina 3-0 ahead courtesy of a perfectly chipped shot over Lampe prior to the interval, having been played through by Aguero.

Some complacency crept into Argentina's game in the second half and it was punished by Bolivia on the hour mark after Saavedra finished clinically into the roof of the net following Leonel Justiniano's driving run to the byline.

Martinez was only on the pitch for two minutes when he netted Argentina's fourth goal in the 65th minute and the merciless South American powerhouse should have had more, if not for the efforts of Lampe during the closing stages.