Arrests, prison terms and a deadly crackdown turn activists against an institution that just two months ago helped them depose a president.

Reporting from Cairo — The Egyptian military is learning a dangerous political truth: A revolution unfinished turns bitter and its heroes can be quickly recast as villains.

Soldiers were swooned over two months ago when they rolled into Cairo's Tahrir Square and stood guard over protesters rallying to overthrow President Hosni Mubarak. But the allure of the long-revered military has faded as the generals running the country face accusations that they are threatening the dreams of a new democracy by cracking down on dissent and failing to bring former government officials to justice.

The so-called Arab Spring has settled into a blur of troubling developments in Egypt. Army doctors forcing detained female protesters to take virginity tests. Labor strikes and sit-ins banned. Dozens of demonstrators missing. A protester dead and 71 injured during an army raid Saturday. Mubarak unpunished and unrepentant while under house arrest in a Red Sea resort. And on Monday, a blogger sentenced to three years in prison for criticizing generals.

"They're playing a dirty game," said Mohamed Abbas, an activist and youth movement leader. "It's our revolution. Yes, the military helped us achieve it. But it's ours and that spirit is coming back. The period of truce between us and the army is over."

The deadly raid Saturday to disperse demonstrators in Tahrir Square was the most pointed indication yet of deepening distrust between the military and the public. The army called protesters agitators. Demonstrators hung in effigy Field Marshall Mohamed Hussein Tantawi, head of the ruling military council, and chanted that he was no better than Mubarak, a former air force commander.

"We've given the army time, but they haven't fulfilled our wishes," said Essam Refaat, sitting, sweaty-faced, with a rolled flag at the edge of a protest in the square last week. "We need to pressure the military to get rid of the remnants of the old regime so there can be no counterrevolution. We don't want the generals ruling from behind anymore."

The military is also encountering pressure from current and former junior officers who have joined the protests and posted YouTube videos accusing the army of protecting former government officials and abandoning the ideals of the revolution. Progressive officers have criticized the 75-year-old Tantawi and the old guard as too inflexible to meet the demands of a changing Middle East.

"The military is concerned and worried about officers dissenting from within," said Ammar Ali Hassan, an analyst and former military officer. "Any divisions from within the military establishment might result in a military coup that would sweep away the legitimacy of our civilian revolution."

Yet, for many Egyptians, the military remains the country's most hallowed institution. It has been the protector of national pride and a counterbalance to Mubarak's reviled police state. It was strong when the civil state faltered. During a bread shortage in 2008, military bakeries supplied millions of loaves to a worried public. And in recent weeks it has taken steps toward democracy, even as it clings to its traditionally authoritarian nature.

Since Mubarak left office after more than three decades, the army has set parliamentary elections, arrested members of the former Cabinet, removed a number of state governors and summoned Mubarak and his sons for questioning over corruption allegations and other charges. The generals have also struggled to revive an economy that lost billions of dollars from tourism and other businesses hurt by the weeks of upheaval early this year.

"We call on all the revolution's conscious youth to cooperate with us and with the silent majority of Egyptians," said Gen. Ismail Etman, a member of the ruling council. "We stress that we guarantee fulfilling all the revolution's legitimate demands. We won't deceive you. We won't fool you and you won't one day regret that the military forces stood by your side."

Overall, said analyst Hassan, "the military council has made a number of good achievements since taking power."

But thousands of demonstrators are no longer convinced. Since the revolution began Jan. 25, about 4,000 protesters have been arrested. About 1,500 of those have been sentenced from six months to five years in prison on charges including spreading false information and assaulting soldiers and police. Fifty-five protesters remain missing and human rights groups have accused the military of torture and illegal detentions.

Among the most troubling cases was the three-year prison sentence given Monday to blogger Maikel Nabil Sanad for insulting the military. The army has long been sensitive about its image and draconian about rebutting criticism. The independent news media were allowed a certain leeway in skewering Mubarak's presidency. But the generals tolerated no caricature or analysis; even today, with seemingly more media freedom, most journalist and writers do not scrutinize the army.