It was the 87th minute of the World Cup game, moments away from Mexico’s historic upset against a reigning world champion, and the classic song thundered across the 80,000 stands once more.

Ay, ay, ay, ay

Canta y no llores (Sing and don’t cry)

As Mexico clinched the win against Germany on Sunday, “Cielito Lindo” wafted from Luzhniki Stadium to the streets of Mexico City, where crowds of people poured into the plazas, honking horns, playing drums and waving flags.

Porque cantando se alegran (Because by singing, hearts get happy)

In sports bars and households from Los Angeles to Washington, they crooned in unison, in pure elation to the song that just about every Mexican knows by heart.

Cielito lindo, los corazones (Pretty sweet one, the hearts)

Millions of Mexicans, celebrating the triumph at home and far away, were united by a song that has become an unofficial anthem for the nation. The song has been passed down through the generations within families both in Mexico and in the United States — at birthday parties, weddings, Mexican Independence Day parties and soccer matches.

“Cielito Lindo” is a symbol of Mexican nationalism, a song for moments of celebration. It has been played by mariachis in Mexico City to greet Pope John Paul II in 1979 and, two years ago, Pope Francis.

It is also a song that lifts the spirits in times of immense tragedy. In September of last year, for example, when a catastrophic earthquake in Mexico left hundreds dead, volunteers collected food and medical equipment while singing a moving rendition of “Cielito Lindo.”

“That song runs so deep that we absolutely had a mariachi play it at my dads funeral,” Michelle Rodriguez, a radio host from Dallas, tweeted during Sunday’s game.

For a song composed in 1882, “Cielito Lindo” has managed to transcend generations and emotions. It is precisely the familiarity of the tune and the simplicity of the chorus that gives the song its universal meaning, according to aficionados of Mexican music.

“It’s both a lament and a cry for joy,” says Leticia Soto Flores, the founding director of one of Mexico’s first schools dedicated to mariachi music.

And some say the song is perhaps more important now than ever. As the country faces a surging murder rate, corruption and a tense relationship with the United States under President Trump, Mexicans are craving symbols of national identity, said Alejandro Madrid, a musicologist at Cornell University who is originally from Mexico.

“Mexicans are trying to latch onto anything that actually creates a sense of unity,” Madrid said.

All the more remarkable, then, that it was originally just a love song written some 130 years ago as a simple serenade for Catalina Martínez, the wife of its composer, Quirino Mendoza Cortés.

Mendoza Cortés worked as a music teacher and a church organist, according to a 1977 biography by Sergio Espinosa Cordero.

“Inspired by his idyllic feeling when looking in the distance at Popocatépetl and Iztaccíhuatl,” two volcanoes in Mexico, the composer “recalls the sweet legend of his love affairs, the image of the bride and the sweet vision of the virgin,” writes Espinosa Cordero.

The song’s verses include references to “a pair of black eyes” and “that mole you have, pretty sweet one, next to your mouth.”

Other lyrics in the song have sparked a debate over whether the song’s origins, or at least the composer’s inspiration, might have been drawn from Spain, not Mexico. For example, the song references the “Sierra Morena,” a mountain range in Spain.

One of the first phonograph recordings of “Cielito Lindo” is believed to have been in 1919, performed by three men with guitars, Soto Flores said. But the song truly began to take off after the Mexican Revolution, during the 1920s, when the government began promoting mariachi music as a national symbol of Mexico, Madrid said.

During the Golden Age of Mexican cinema, the 1947 film “Los Tres García,” starring Pedro Infante, helped push “Cielito Lindo” further to the mainstream, Soto Flores said.

The song would eventually be taught in Mexican elementary schools and even in some schools in the United States.

Over the years, it has been sung by scores of artists, among them Plácido Domingo, Luciano Pavarotti, Tito Guizar, Eartha Kitt and Ana Gabriel.

Its catchy tune was ideal for singing along in groups, an essential feature of Mexican social gatherings and celebrations, said Ignacio Bonilla Arroyo, who sits on Mexico’s National Commission for the Safeguarding of the Mariachi.

It became the song you heard your grandmother humming in the kitchen, the tune your uncle requested from mariachi performers at family parties.

“It’s so ubiquitous,” Soto Flores said. “You don’t even know how you learned it; you just know it.”

But it was not until about 1998, when the World Cup took place in France, that groups of Mexicans began singing the tune at international soccer games, Madrid said.

Madrid argues that this tradition was inspired by other soccer fans, such as Argentines, who are known for singing at games. But some of those fans tend to be “violent,” Madrid said. When the tradition arrived in Mexico, the crowds in the stadiums were often filled with families and children, Madrid said. Mexican fans needed a song that was less rowdy and more universal.

“Cielito Lindo” was the obvious choice. “It was something that everybody knew, so it was easy for everyone to actually join in,” Soto Flores said.

So even though “Cielito Lindo” was a love song about a 19th-century woman, it became a song synonymous with Mexican soccer.

For a while, the song was so commercialized that some argued it had become a cliche. But in recent years, observers such as Mexican writer Pável Granados, have argued that it is seeing a “remarkable” rebirth.

“The refrain ‘sing and do not cry’ has a new meaning, because in the face of misfortune we have to sing,” Granados told Mexican newspaper Excélsior last year, on the 60th anniversary of the composer’s death. “That defines us today because of everything that happens in Mexico. Hidden in those verses was something very much ours.”

Sergio de La Mora, an associate professor in the Chicano and Chicana studies department at the University of California at Davis, said the song “evokes a nostalgia for pastoral and romanticized Mexico that doesn’t exist and perhaps never existed.”

“I think when folks began singing this song in soccer matches it renewed the song’s life and resignified the meaning of the song as a sort of unofficial national anthem,” de La Mora added.

Through Mexico’s many uncertainties, including its upcoming July 1 presidential election, the song is a reminder of stability, of unity, of hope.

“For all the hardship we might suffer as Mexicans, for all of the problems we might have,” Bonilla said, “We always have that verse: Canta y no llores.” Don’t cry — sing.