Sergio Aguero sealed an unconvincing Argentina side's passage into the quarter-finals of the Copa America as they saw off Qatar in Porto Alegre.
Aguero's late right-foot drive from 15 yards sealed a 2-0 win after Lautaro Martinez netted in the third minute.
Bassam Al-Rawi, whose misplaced pass had allowed Martinez to score, hit the post for Qatar, who are eliminated.
Lionel Scaloni's side finish second in Group B behind Colombia, and will face Venezuela in the last eight.
Meanwhile, group winners Colombia's 1-0 win over third-placed Paraguay ensured Argentina's progress.
A 2-0 defeat by Colombia and a 1-1 draw with Paraguay had meant that Argentina had to beat the group's bottom side Qatar to a avoid a humiliating group-stage exit from the competition.
However, it was far from a comfortable evening for the two-time World Cup winners against the 2022 World Cup hosts, who are ranked 55th in the world - despite making the perfect start, with 21-year-old Inter Milan forward Martinez scoring so early.
Manchester City forward Aguero and Barcelona's Lionel Messi, who produced an underwhelming performance, both missed excellent opportunities while Qatar threatened on the counter-attack until Aguero's late intervention.
Argentina now face Venezuela in their quarter-final on Friday, 28 June at the Maracana in Rio de Janeiro.
Have your say
More Sports Headlines
- Senegal v Algeria: kick-off time, team news, head to head, form and more
- Ghana to face South Africa in AFCON 2021 qualifying
- Amaju Pinnick dismissed as Caf vice-president
- Mikel Obi retires from international football
- A fifth “All-African Coaches” AFCON final
- Juventus sign De Ligt on five-year deal
- AFCON 2019: Ighalo hands Nigeria bronze
- Atletico Madrid sign Tottenham defender Kieran Trippier
- Kotoko midfielder Kwame Bonsu completes move to Esperance
- CAF adopts one-leg finals for club competitions
- Real Zaragoza sign Raphael Dwamena from Levante
- Caf expands Women's AFCON to 12 teams
- Tunisia v Nigeria: kick-off time, team news, head to head, form and more
- Blatter labels Samoura's Caf move 'colonialist'
- Pernell Whitaker was unique - Eddie Pappoe