Two second-half goals by Neymar and Roberto Firmino saw Brazil beat Mexico 2-0 in a 2018 FIFA World Cup round of 16 contest at the Samara Stadium in Russia.
Both teams played a goalless draw when they met in the group stages of the 2014 edition of the competition in Brazil.
With the defeat on Monday, Mexico are once again eliminated at the last-16 stage – as they have been at every World Cup since 1994.
And with the goals, Brazil hit their 227th goal at the mundial, meaning they overtake Germany as the all-time top scorers.
After a largely frustrating first half, Neymar opened the scoring in the 51st minute when a cross from Willian went past the Mexican goalkeeper and past Gabriel Jesus to land on his foot as he chipped in.
The PSG star was also involved in the second goal, as his neat pass in the box was played into the net by substitute Firmino in the 88th minute.
With the victory, the five-time champions secured a spot in the quarterfinal of the tournament, where they face either Japan or Belgium, who play later on Monday.
Brazil are reaching the World Cup quarter-finals for a seventh consecutive time.
RipplesNigeria… without borders, without fears