In the midst of preparations for Mexico's independence day celebrations, hundreds of people gathered in response to a social media campaign demanding President Enrique Peña Nieto's resignation.
Most of the marchers were young people, and turnout, in a city of 20 million, was relatively small. But its timing reinforced the country's dissatisfaction with Peña Nieto.
The president suffers from abysmal approval ratings that risk plunging even more after last month's widely ridiculed meeting with U.S. Republican presidential candidate Donald Trump. His party in June lost gubernatorial elections in four states it had never lost before.
A heavy police presence prevented the marchers who grew to several thousand from reaching the Zocalo, the city's central square where thousands of others had gathered for the annual independence eve ceremony. The crowd eventually began to disperse peacefully.
Peña Nieto was marking the national celebration with the traditional shout of independence in the Zocalo later Thursday night.
Activist Ignacio Del Valle was among the protesters.
"We have nothing to celebrate," Del Valle said. "On the contrary, the motive of our presence in this protest of dissatisfaction is just this: to repudiate Peña Nieto."