Guinea-Bissau's prime minister has resigned after 20 days in the post and two days after appointing his cabinet.
Baciro Dja handed in his resignation after the Supreme Court ruled his appointment violated the constitution.
There has been political turmoil in the West African nation since President Jose Mario Vaz sacked all his ministers last month.
With a history of coups, no elected leader has served a full term since independence from Portugal in 1974.
President Vaz sacked the previous prime minister - Domingos Simoes Pereira - after a series of rifts including the naming of the new army chief, the AFP news agency reports.
A week later he appointed Mr Dja by presidential decree, against the wishes of the ruling PAIGC party.
The Supreme Court judges said that Mr Dja had been given the job without properly consulting the political parties in parliament.
There have been demonstrations over Mr Pereira's dismissal, but they have been peaceful and the military has vowed to stay out of the political tug of war, Reuters news agency reports.
- Five coups since 1980
- One of the poorest countries in the world
- Major hub for cocaine smuggled from Latin America to Europe