Last August, a statue of Heydar Aliyev, who ruled Azerbaijan from 1993 to 2003, was erected along Mexico City’s grand Paseo de la Reforma, in a park renamed the “Mexico-Azerbaijan Friendship Park.” Around the same time, the Azerbaijani government built a second monument in a different park in memory of Azeri villagers killed by Armenian forces in 1992; the plaque in front of the statue refers to the massacre as a “genocide.” Azerbaijan had renovated both public spaces at a cost of about $5.4 million.

The inauguration of the Aliyev monument was attended by several top Mexican government officials, including the mayor. But the Mexican public, then engrossed in a presidential election campaign, paid little attention to a statue of a man who once led a country 8,000 miles away.

When the nouveau riche attempt to use their money to buy respect and prestige, it often backfires. Such was the case of the Azerbaijani government’s effort to honor its former president. Because once Mexico City residents became aware of the statue that had risen in their midst, they saw the effort for what it was: an authoritarian government clumsily trying to buy influence and whitewash the legacy of a dictator.

This past weekend it ended in humiliation for Azerbaijan, when city workers, guarded by 200 police in riot gear, loaded the monument onto a flatbed truck in the middle of the night and carted it away. “Now everybody talks about Azerbaijan, but in a bad way,” said Guillermo Osorno, a prominent journalist and member of a government commission appointed to study the monuments.

Aliyev’s legacy is a complex one. Most Azeris credit him with leading their country, an oil-rich ex-Soviet republic wedged in between Russia and Iran, out of a deep crisis in the 1990s, when Azerbaijan’s economy collapsed and the country lost a disastrous war with Armenia. Aliyev’s steady hand put the country on a path to prosperity; the country enjoyed double-digit GDP growth for more than a decade. But he was also a ruthless dictator, true to his roots as a former head of Soviet Azerbaijan’s KGB.

Azerbaijan is now led by Aliyev’s son, Ilham, who has aggressively built up a cult of personality to his father. Heydar Aliyev’s presence is ubiquitous in Azerbaijan. Posters and billboards of the ex-president look down at citizens everywhere, every city has a major street named after him, and there are more than 60 museums and cultural centers across the country that bear his name. In 2008, Baku State University created a “Department of Aliyev Studies.”

But the internationalization of his cult of personality is a newer development. Over the last several years, Azerbaijan has arranged for at least 14 statues of Aliyev to be erected around the world, mainly in the Middle East and the former communist world. Mexico City’s was the one farthest away from Azerbaijan and the first in the Western hemisphere.

Along with the Aliyev cult of personality, Azerbaijan also has been trying to advance its own interpretation of disputed recent history. In particular, it has sought international recognition of the 1992 massacre of hundreds of Azeri civilians in the village of Khojaly as a genocide. While certainly a war crime, the massacre—by official Azerbaijani accounts, 485 were killed—falls several orders of magnitude short of what is conventionally considered an attempt to wipe out an entire people. The massacre took place during the war over the territory of Nagorno-Karabakh, which Azerbaijan ultimately lost and the recapture of which is now the country’s top priority. So the real aim of the Khojaly campaign appears to be a weakening of Armenia’s greatest claim to moral authority: its own genocide, when between 600,000 and 1.5 million Armenians were killed by Ottoman forces in 1915.

Until recently, Azerbaijan had been making good progress in advancing its agenda in Mexico. Mexico’s Senate in 2011 passed a resolution calling Khojaly a “genocide,” one of only a handful of governments in the world to do so. (Mexico has never formally recognized the events of 1915 as such.) The same year, Mexico City’s Museum of Memory and Tolerance hosted an event commemorating Khojaly.

But Azerbaijan seems to have overreached with the Aliyev statue. The monument initially drew little notice—as early as April, four months before it was erected, the Azerbaijani Embassy said it wanted a monument to Aliyev in the park. But the controversy only began in early September, a couple of weeks after the statue’s inauguration.

Osorno was tipped off by members of the park council who were unhappy that the city government had pushed the statue through over their objections. A few minutes of research led him to the New York Times obituary for Aliyev, which he quoted in his first column about the statue:

His authoritarian rule was characterized by contradictory trends. While it undoubtedly brought a measure of stability to Azerbaijan, political life remained turbulent, with frequent reports of coup and assassination attempts against Mr. Aliyev and equally frequent complaints by his opponents about electoral malpractice, human rights abuses and a muzzled press.

Mexico City’s intelligentsia is sensitive to such practices, having only recently emerged from a decades-long dictatorship itself. Moreover, Mexico’s capital is a liberal oasis; in 2009 it legalized gay marriage. “This is a city that prides itself on its liberty, and we don’t like the symbolism of having Heydar Aliyev in Chapultepec,” he said, referring to the park. “The monument is appalling—in bad taste and in a very strategic position,” on Mexico City’s stateliest avenue, near statues of Gandhi and Winston Churchill.

The controversy grew and soon became a cause célèbre among the city’s chattering classes, leading to a steady stream of opinion articles and talk-radio debates. A three-member commission of prominent intellectuals (Osorno being one) was formed to study the matter and in November issued recommendations to remove the Aliyev statue and to change the wording on the Khojaly monument from “genocide” to “massacre.”

Azerbaijan’s ambassador to Mexico, Ilgar Mukhtarov, tried to defend the statue—unsuccessfully. In an interview, Mukhtarov claimed that the silent majority of Mexicans was behind him, though he wasn’t able to provide evidence of supporters other than the handful of Azerbaijani expats living there. He claimed that the controversy was ginned up by the country’s Armenian community, a standard Azerbaijani government trope. (Mexico’s Armenian community is tiny and diffuse but well-connected: The former rector of the country’s top university, Jose Sarukhan Kermez, is of Armenian descent and has campaigned against the statue. Still, his role was hardly decisive.) He also claimed that the city of Cleveland has a Heydar Aliyev park (not true) and acknowledged that Aliyev’s record wasn’t perfect, but neither was that of many Mexican presidents who have statues in the city. Aliyev “is our national hero, not Mexico’s, and it’s our right to recognize our national leader,” Mukhtarov told me.

Azerbaijan’s most convincing argument is that a deal is a deal: It’s not Azerbaijan’s fault that Mexicans didn’t pay attention to the statue until after it was built. During my meeting with him, Mukhtarov said that he would not accept any outcome other than the statue staying where it was, and if Mexico City were to remove the monument, the embassy would take the matter to an “international court.” But since the statue was removed early Sunday morning, he seems to have softened his stance, telling the Russian press that he is working with the city to establish an Azeri cultural center, which would be the new home of the statue. The fate of the Khojaly “genocide” memorial is still an open question.

Today, Aliyev’s monument sits in a warehouse in Mexico City’s Department of Housing and Urban Development. A Web video of the statue’s removal shows it being unloaded into a dirt yard, strewn with debris and stacks of bricks. It’s an ignominious fate for the hero of a nation.