NAYPYIDAW, Myanmar — Three years after Myanmar’s ruling generals shed their uniforms and propelled the country on an ambitious journey toward democracy, security forces are back on the streets of the former military dictatorship.

A rampage by radical Buddhists in the sprawling city of Mandalay that left two people dead this week spurred the authorities to declare a nighttime curfew, dispatch hundreds of riot police officers and erect razor wire around the Muslim neighborhoods that were attacked.

The violence raised fears that the rioting that has hit provincial towns in the past two years might now spill over into Myanmar’s most populous and important cities.

It was also yet another in a string of disappointments that have worn away at the euphoria that greeted the end of five dark decades of military rule. Among the most worrisome setbacks are the attacks in western Myanmar on an ethnic minority called the Rohingya, an apparent rollback of some press freedoms and tepid commitments by foreign investors who are crucial to building the nation’s impoverished economy.