ADDIS ABABA, Ethiopia -- Ethiopian lawmakers have approved the state of emergency announced by the government last month to control continuing anti-government protests in various parts of the country.

The parliamentarians on Friday passed legislation to keep the emergency in place for six months, with the possibility of extending it for a further three months.

The measure passed with 395 members of parliament voting for it, 88 against and seven abstentions. The opposition is unprecedented in recent Ethiopian politics as all lawmakers are from the ruling coalition or from affiliated parties.

The emergency is needed to restore order that has been disrupted by the anti-government demonstrations, said Prosecutor General Getachew Ambaye. "Recent developments in various parts of the country have indicated that citizens' rights were curbed and even the free movement of people was jeopardized. Ethnic-based violence was on the rise in some areas," he said. "The state of emergency is needed to safeguard constitutionally guaranteed rights."

Major Western allies including the European Union have raised their concerns about the emergency and the American embassy said it "strongly disagrees" with the law.

"The challenges facing Ethiopia, whether to democratic reform, economic growth, or lasting stability, are best addressed through inclusive discourse and political processes, rather than through the imposition of restrictions," said the U.S. Embassy on February 17, the day after the emergency was announced.

Sporadic violations of the emergency have been reported in some parts of Ethiopia and a security forces command post has been instructed to take appropriate measures to restore order. Some fear this may lead to the arbitrary use of force.

Hundreds have been killed in Ethiopia since November 2015 when the anti-government protests started calling for wider political freedoms. Several thousand have been detained but the majority have been released.

This is Ethiopia's second state of emergency in two years and it came a day after Prime Minister Hailemariam Desalegn resigned. The election of a new prime minister is expected early next week.

Ethiopia is a Western ally but the government is often accused of violating human rights and detaining activists, opposition politicians and journalists. It recently released more than 6,500 politicians and individuals as part of the government's pledge to open up the political space for all.