RIO DE JANEIRO — Brazilian fans jumped with joy and samba danced Monday while thousands of miles away, Mexican counterparts sang melancholy renditions of a folk song after Brazil knocked off Mexico 2-0 to advance to the World Cup quarterfinals.
The game between the national teams of Latin America's two most populous nations came at a time when both are faced with myriad problems, from corruption to violence, making the World Cup an especially welcome distraction.
"This is all an escape," said Michele do Carmo, a 36-year-old clothing school attendant who skipped work to watch the game with thousands at a square in Rio de Janeiro. "Football won't solve our problems, but strong play by the national team will raise Brazilians' self-esteem."
"Lately our self-esteem has been very low," she added over the roars of cheering fans.
In Mexico, the mood was somber after the match, though some expressed pride in a team that played strongly against a squad that many believe could win the tournament.
"Going into the game, everybody was afraid because Brazil is so good, but then they played well and I thought we had a chance," said Mexican fan Jhakelyn Becerril, 17, shuffling away from the big screen TV where she watched the match on Mexico City's main avenue.
Fans clustered together nearby singing a melancholy rendition of the Mexican folk song "Cielito Lindo."
"Ay, ay, ay, ay, sing and don't cry," they sang in Spanish.
In Brazil, streets were largely empty as millions took off work and schools were shuttered so people could watch the team play on televisions in bars, squares and beaches.
In Praca Maua square in Rio de Janeiro, thousands watched the game on a giant screen akin to a drive-in movie theater. People climbed trees to get better views while others drank beer and caipirinhas, a mixture of hard alcohol and limes. Fans jumped and screamed at each of the two goals.
Juliana Galvao, a 10-year-old who plays soccer, gushed about the win.
"This means I won't have school on Friday" during Brazil's next matchup, she laughed.
Many schools have canceled classes on game days, while employers let people come in after the games or watch them at work.
While five-time champion Brazil was the favorite, several upsets have unleashed an anything-can-happen feeling. Mexico pulled off a huge upset in its first game of this year's tournament, beating 2014 champions Germany 1-0. Germany has since been eliminated, as have Spain, Argentina and Portugal. Brazil and the tiny nation of Uruguay are the only Latin American teams left.
In Mexico, the game came a day after Andres Manuel Lopez Obrador won a decisive victory in his third try for the presidency.
The former Mexico City mayor campaigned on promises oust the "mafia of power" ruling the country and tackle issues that have long plagued the southern neighbor of the United States: drug trafficking, violence, corruption and widespread inequality.
Brazil, just a few years ago a darling of the world community because of rapid economic growth, is today plagued with many of the same problems as Mexico, and voters appear to be in a kick-the-bums-out mood ahead of presidential elections in October.
"Brazil needs a win, because it's losing in all other areas: in the economy, education, public health and security," said Gabriel Santos, 23, as he partied at the Praca Maua. "Without this victory, Brazil isn't winning anywhere. "
Associated Press reporter Amy Guthrie in Mexico City contributed to this report.