Porto Alegre: An early goal by Lautaro Martinez and Sergio Aguero's late second gave Argentina a 2-0 win over Qatar on Sunday that qualified them for the Copa America quarter-finals.
Already-qualified Colombia beat Paraguay 1-0 in the other Group B match to secure a place in the last eight for both Peru, who finished third in Group A, and Uruguay, currently second in Group C.
Argentina, who finish second in Group B behind Colombia, will play Venezuela at Rio de Janeiro's iconic Maracana stadium in the quarter-finals, while tournament debutants and guests Qatar are out.
Paraguay, on two points, must wait and see what happens in Monday's Group C clash between Japan and Ecuador before finding out if they qualify as one of the two best third-place finishers.
Peru, with four points, are sure of that while only a draw between Japan and Ecuador would see Paraguay progress.
Argentina coach Lionel Scaloni recalled Manchester City forward Aguero for the crunch tie while Martinez kept his place at the expense of Angel Di Maria.
Asian champions Qatar made a calamitous start when a weak headed clearance from Tarek Salman fell to Martinez 12 yards out, but the Inter Milan forward sent his volley over the top.
Messi burst into life with an acceleration towards Qatar's area before slipping a pass to Aguero, who dragged his left-footed shot wide under pressure.
Qatar were sporadically dangerous on the break and Portuguese-born Ro-Ro stole in at the back post to meet a Karim Boudiaf cross but couldn't direct his volley on target.
Up the other end, Nicolas Otamendi headed over from close range when it looked easier to score.
Argentina almost scored a second after Qatar goalkeeper Saad Al-Sheeb spilled a header by Martinez causing a scramble in the box, but neither Aguero nor Martinez could poke the ball home.
Iraq-born Hisham almost made amends for his earlier gaffe with a free-kick at the end of the half but his shot, which passed through the Argentina wall, cliped the outside of the upright.