MEXICO CITY — When Mexicans think of Emiliano Zapata, most envision a stern-eyed rebel, a hero of the Mexican revolution, a historical figure who inspired the 1994 uprising in Chiapas.

They do not picture him naked and in high heels — sporting a pink sombrero.

So the country was in an uproar this week after its most prestigious art center featured a painting showing a feminized version of the national icon. Zapata’s descendants threatened to sue. Social media exploded. Farmers who idolize Zapata smacked and shoved gay rights activists outside the Fine Arts Palace, the showplace of Mexican culture.

Things got so hot that President Andrés Manuel López Obrador had to intervene.

The controversy comes as Mexico’s traditionally macho culture is being increasingly challenged by women and gay couples fighting for more rights and respect. Calls to remove the painting from the exhibit — or even burn it — were rejected by the government.

As debate raged on Twitter and talk radio, some Mexicans argued the painting was demeaning. Others noted that Zapata had already been adopted as a symbol by U.S. Chicanos, Mexico’s indigenous peasants and other groups. So why not gays?

“This is a controversy about how to represent our national heroes, and who is allowed to do it,” said Guillermo Osorno, a well-known writer on culture. The painting, he said, “doesn’t say Zapata is gay, but that he also belongs to the gay community, as a symbol of sexual dissidence, a symbol of the sexual revolution of the 20th century.”

The painting was part of an exhibit of 141 works representing Zapata in different ways — as a leader of the 1910-20 Revolution but also an “icon of feminist battles and contemporary activism,” as the government’s fine-arts institute described it.

Zapata’s image is as ubiquitous in Mexico as George Washington’s is in the United States, appearing on buildings, money and T-shirts. The Mexican hero is almost always depicted as somber, with a bushy mustache and a sombrero. That’s why many people were shocked by the painting, “The Revolution.” It shows Zapata naked, with a sinuous female body, astride a white horse that has an erection. He wears black high-heeled shoes shaped like pistols.

The Fine Arts Palace featured the image in its advertising for the exhibit, which opened late last month.

For Zapata’s relatives, it was too much. On Monday, they announced they would sue the painter and the government.

“This is defaming the image of our general, painting him as gay,” Jorge Zapata, surrounded by other relatives, told journalists on Monday.

Many Mexicans agreed. “This is the most disgraceful thing ever,” Armando Manzanero, a prominent composer, told the daily Reforma. “Instead of high heels, he should have been shown with big balls.”

In rural areas, Zapata is still revered for his crusade to provide land to the poor, and for his leading role in the Revolution that ousted dictator Porfirio Diaz in 1911. On Tuesday, scores of farmers — many holding flags with Zapata’s image — blocked the entrance to the Fine Arts Palace in Mexico City. “Burn it, burn it!” they yelled about the painting.

When a small group of gay rights activists showed up, the peasants yelled slurs and began pushing and punching them.

The images, broadcast on national TV, prompted the Mexican government to step in.

“Artists have total freedom and we can’t have censorship,” López Obrador told a news conference. “What is all this about entering the Fine Arts Palace and punching people? We totally reject this.”

Fabián Cháirez, the artist, said he painted “The Revolution” several years ago to take aim at the “hypermasculine” images of Mexicans in movies and advertising — images that were influenced by the figure of Zapata.

“I made my own version, which presented a different form of representing men,” he told CNN en Español.

Gay people and women have increasingly demanded more rights and protection in this traditionally conservative, male-dominated society. For months, women have demonstrated against violence and crime targeting them. Same-sex marriage is now legal in the capital and 19 of Mexico’s 31 states.

Lorenzo Meyer, a prominent historian, said Zapata remained a popular figure because of his humble origins and his idealism. His legacy is so powerful that indigenous rebels who launched an uprising in southern Chiapas state in 1994 called themselves the Zapatista Army of National Liberation.

Zapata’s enemies “couldn’t co-opt him, they couldn’t corrupt him, they couldn’t make him abandon his cause,” Meyer said. The revolutionary was killed in an ambush in April 1919.

Back in those days, he said, Zapata was not a symbol of masculinity.

“Practically everybody in Mexico was macho at that time,” he said.

On Thursday, the Mexican culture ministry announced it had reached a compromise with the Zapata family: The painting would remain in the exhibit but would no longer be featured in official advertising. The Zapata family would be allowed to post a statement next to the work expressing its disapproval.

The controversy over the painting has revived old rumors that Zapata may have been gay. Meyer said there is no evidence of that. If he was, it wasn’t a public issue in revolutionary Mexico.

“This reflects the concerns of today being projected onto the past — not those of Zapata or those involved in Zapatismo,” he said.