In other countries rocked by Arab Spring uprisings, tensions today are being felt largely over the role of Islam in government. These issues have come up in Morocco, too. But here, the larger tensions appear to be over the power of the old guard. Many Moroccans will not criticize the king, instead focusing on the network of power and privilege that surrounds him and the corruption that they believe sucks any hope of prosperity from this country.

The problems Morocco faces are enormous. The country has invested heavily in infrastructure: superhighways are everywhere and there are plans for a high-speed train, too. But 40 percent of the population cannot read or write. Forbes has estimated the king’s fortune to be more than $2 billion. But the average income here is low, roughly half of what it was in Tunisia, where the Arab Spring first took off.

Image Morocco, strategically important, is just south of Spain. Credit... The New York Times

Mr. Benkirane took office showing a flair for the dramatic. He quickly slashed ministerial salaries and perquisites, and he refused to move to the prime minister’s mansion. He also took on Morocco’s notorious cronyism. To widespread amazement, his government published the names of those who had been given lucrative bus licenses. Since then, however, his efforts have foundered.

Some critics say the prime minister has been outmaneuvered at every turn. Once last spring, Mr. Benkirane seemed to lash out at the king and his entourage, suggesting that protesters could easily return to the streets. But soon after, he said the remarks had been misunderstood.

In August, he suffered what some saw as a serious public humiliation when an outdoor event at which he was to be the main speaker, planned months ahead of time, was abruptly canceled the night before by the Interior Ministry for reasons that remain unclear.

“I think there are functionaries in the ministries who have not yet changed,” said Imane Yakoubi, a member of the governing board of the Justice and Development Party’s youth league.