Ecuador's President Lucio Gutierrez has fired the Supreme Court and declared a state of emergency in the capital, in a bid to resolve a political crisis.
Anti-government protests have been building all week
Speaking on television, Mr Gutierrez said he had taken the drastic measures in order to maintain calm and stability in the country.
It follows mass protests and strikes in Quito against the government.
The unrest was sparked by a government attempt last year to restructure the Supreme Court.
The state of emergency empowers the Ecuadorian government to take extraordinary measures to quell unrest.
Up to 10,000 people have been protesting in the streets of Quito since Thursday, banging pans and demanding the president's resignation.
Reports suggest that demonstrations continued into Friday night after Mr Gutierrez's announcement.
Last week, the president took the unusual step of declaring that he still had the support of the armed forces, and that they would not intervene in the growing constitutional crisis.
The crisis began in December, when Mr Gutierrez first fired the Supreme Court, alleging that the magistrates were biased against him.
The crisis deepened in March, when the new court dropped corruption charges against ex-President Abdala Bucaram.
Mr Bucaram's Roldosista Party had backed Mr Gutierrez's drive to replace the Supreme Court. The party also helped to block an opposition attempt to impeach Mr Gutierrez in November.
Opponents say dismissing the judges was part of a government deal to exonerate Mr Bucaram in return for his political support.
But Mr Gutierrez said the old court had to go because its judges were biased in favour of opposition parties, particularly the Social Christians.
The UN and the US criticised his dismissal of the Supreme Court in December, and opposition politicians have accused him of behaving like dictator.
Since 1997, two presidents of Ecuador have been forced out of office by street protests.
The BBC's Hannah Hennessey in Lima says Mr Gutierrez's latest move suggests he has no plans of becoming the third president to go that way.