MEXICO CITY — As President Enrique Peña Nieto prepared for the beginning of Mexico’s Independence Day celebrations, protesters took to the streets of capital on Thursday to demand his resignation.

Chanting “Peña out,” several thousand mostly young demonstrators marched peacefully past the glass towers of the city’s main boulevard, Paseo de la Reforma, in the waning afternoon light, hours before the president, whose government has been buffeted by a series of scandals and a weakening economy, was to formally start the long Independence Day weekend by ringing a bell on the balcony of the National Palace.

“I am here because I want my country to have a political system that holds an official accountable for bad performance,” said Alberto Serdán, 37, a public policy researcher and blogger. With each crisis, Mr. Serdán added, the government “simply loses any notion of dignity and capacity to rule.”

Mr. Peña Nieto has become Mexico’s most unpopular president in a quarter-century, opinion polls show, as frustrations mount over entrenched corruption and anxiety rises over economic stagnation and an increase in murders to the highest level since he took office.