CAIRO, Egypt — The governments that rose to power in Egypt and Tunisia in the wake of the Arab Spring are increasingly relying on the oppressive security apparatuses crafted by their predecessors.

Whole-scale reform of the security services in both countries, where police were viewed as predatory foot soldiers for the regime, was a central catalyst for the uprisings two years ago.

But as the two North African nations now grapple with heightened and sometimes violent unrest — the result of stalled political and economic progress — the government of Mohamed Morsi in Egypt and Tunisia’s Ennahda leadership are embracing the unreformed police forces as necessary tools to quell opposition to their rule, activists say.

In Egypt, an interior minister appointed by Morsi — a former leader of the Muslim Brotherhood — is presiding over a fierce crackdown on both violent protesters and peaceful activists.

Tunisians say the Ennahda-led Interior Ministry, meanwhile, continues to torture and turns a blind eye to attacks by extreme Islamists on liberal opposition groups — including the assassination of vocal government critic and human rights advocate, Chokri Belaid, earlier this month.

“The police are returning to their ways in the time of [former Egyptian President Hosni] Mubarak,” said Hafez Abu Seada, the president of the Egyptian Organization for Human Rights. “They are a tool of oppression in the same way that they were. They are working for the Muslim Brotherhood now, and it should not be this way.”

The Islamists now in power had long been opponents of the authoritarian police states in Egypt and Tunisia, where for decades they were persecuted and tortured inside prisons.

The security institutions they inherited were vast, secretive, brutal and corrupt. As internal armies loyal to the presidency, police and intelligence services in both countries spied on dissidents, thwarted political change and treated even the non-politicized populations with casual brutality.

Both the Brotherhood and Ennahda promised voters they would remake the interior ministries as forces that protect the rights of the people.

“The Interior Ministry has been working for a long time for its own institutional interests, and not maintaining security for the people,” said Ahmed Al Nahhas, a Brotherhood leader in Alexandria, Egypt’s second-largest city. “They must be re-educated.”

But campaign pledges soon gave way to the harsh realities of political power. Reforms stalled, economies tanked and restless opposition movements stirred.

Before long, analysts say it became easier for the new governments to employ the unchanged security forces to curb unrest than to embark on the mammoth and politically risky task of restructuring the police forces.

In some cases, the Islamist leaders faced hostility from security services who are not only resistant to change, but also resent the rule of movements they were long told were enemies of the state.

Last week, hundreds of policemen staged a near nationwide strike to protest what they said was the president’s use of police conscripts as tools in political contests with his opponents. They grew upset after being ordered to protect the headquarters of the Muslim Brotherhood, and accused the Morsi-appointed interior minister, Mohamed Ibrahim, of being too close to the leader.

“Morsi is the son of a whore. The country is in ruins,” said one police sergeant in the Nile Delta town of Tanta, who wished to remain anonymous.

The Brotherhood says this type of animosity is indicative of the uphill battle they face in dealing with and attempting to reform the security forces.

“How is it possible that we control the Interior Ministry when the police would not allow Muslim Brotherhood members to enlist?” Nahhas said, referring to a long-standing policy of banning Islamists from entering the police force. The policy ended last year.

After it assumed power in late 2011, Tunisia’s Ennahda installed one of its own — Ali Laaryedh, a former political prisoner once tortured by Ben Ali’s police — as the new interior minister.

Civil society groups had high hopes for reform in the country, where, according to the United States Institute for Peace — a nonpartisan group — educational standards are high for entrance into the police force, security infrastructure is solid and rules of engagement are clearly established.

“Installing Laaryedh has only made the Interior Ministry more neutral, and more likely to work for the interests of the people,” said Fathi Al Mahri, Ennahda’s chief in the Sousse province south of the capital, Tunis.

But divisive political climates and ailing economies frustrated aspirations for reform.

“As political and social protests continue on the one hand, and on the other hand, the government is less able to provide — the only thing they can do as a government is repress,” said Karim Medhat Ennarah, security sector researcher at the Egyptian Initiative for Personal Rights (EIPR).

Pro-democracy activists and rights groups in Tunisia say police abuses like protester beatings and sporadic torture continue, including against government opponents. The police force under the Ennahda government has failed to investigate or prosecute perpetrators of mostly religious-based attacks against liberal establishments like bars, art galleries and cinemas, Human Rights Watch said.

“There is a fear among people that if they speak out against Ennahda, the government will use the Interior Ministry to target them,” said Tunisian blogger, Neila Kelani. “We went out for what would have been a 100 percent peaceful protest after the assassination of Chokri Belaid, and we were attacked by police with tear gas.”

Instead, the government has ordered the arrest of Tunisian bloggers for “offending Islam.”

“Before the revolution, the ministry was very much an opponent of Ennahda,” said Ali Zeddini, vice president of the Tunisian League for the Defense of Human Rights. “Now the tables have turned, and the ministry is working in Ennahda’s interests.”

In Egypt, where anti-Morsi protesters have grown increasingly violent — carrying out attacks on the presidential palace and other government buildings — the Brotherhood government’s rhetoric grew increasingly more security-oriented.

Morsi vowed to respond with “firmness” to the turmoil and appointed a new Brotherhood-friendly interior minister, Mohamed Ibrahim, in January. Since then, police forces have operated in an environment of impunity, rights groups say, using indiscriminate and often lethal force against activists and protesters.

Both protesters and ordinary citizens have been killed, or tortured to death in detention, and not a single police officer has been publicly investigated or reprimanded.

This week in Port Said, workers and demonstrators shut down shops, factories and banks to protest the lack of an official investigation into an incident last month between police forces and the local population where 40 people were killed.

But even Egypt’s prosecutor-general, appointed by Morsi, is now spearheading an effort to protect security forces under the new government, Ennarah of the EIPR said.

The public prosecutor is renewing the detention of prisoners without evidence — sometimes without even a basic police report — EIPR said.

Ennarah, who has worked with the president’s advisory team on proposals for security sector reform, said, “the role of the prosecution” in aiding police impunity is new.

According to rights groups, they proposed the immediate implementation of simple reforms to the presidential office like the creation of an independent commission to investigate the illegal use of firearms by security forces, or small monitoring teams to make visits to detainees in prison. These are reforms, they say, that require minimal financial resources and manpower.

They were rebuffed.

“They want a compliant police force, rather than a reformed one,” Ennarah said of the Morsi administration.

“In the absence of any will or interest of any kind in reforming the security services, the government is going to constantly be at loggerheads with the population,” he said.

Heba Habib contributed reporting.