Peru's President Alejandro Toledo has demanded all his ministers step down following the resignation of Prime Minister Carlos Ferrero.
Alejandro Toledo is to decide which ministers will stay in their jobs
Mr Ferrero quit after the president named as foreign minister an ally who has backed moves to make growing coca leaf legal in some areas.
Mr Toledo said he would evaluate which of his ministers would keep their jobs.
The newly appointed Fernando Olivera, criticised as a divisive figure, is among those who will have to step down.
Mr Toledo said ministers who planned to run for election to Congress next year would have had to stand down by early October anyway.
Making a brief statement to the press, he said the cabinet's resignation would give ministers the "necessary time to prepare" for the polls.
He made no mention of the surprise resignations earlier of Mr Ferrero and the popular Housing Minister Carlos Bruce in the wake of Mr Olivera's appointment.
Mr Ferrero, who is expected to be among those standing for Congress, gave no reason for quitting earlier on Thursday but said it was "irrevocable".
The BBC's Paul Keller in Miami says the resignations spell more trouble for Mr Toledo, who has had dismal approval ratings since taking office in 2001.
Mr Ferrero is a political heavyweight who had opposed Mr Olivera's support for expanding legalised coca leaf growth, our correspondent says, fearing it could fuel cocaine production in Peru.
But Mr Toledo owes much to Fernando Olivera, he adds, because his party has provided crucial support in Congress, where the governing party lacks a majority.
Mr Bruce had also opposed Mr Olivera's backing for moves by regional governors in Cuzco to allow the growing of coca in certain areas.
The government initially opposed the decision, but was forced to back down.
Mr Olivera's Independent Moralising Front (FIM) party, an influential member of Mr Toledo's ruling coalition, backed the Cuzco governors' move.
Critics, including members of the governing coalition, have called Mr Olivera a divisive figure.
He was Justice Minister in Mr Toledo's first cabinet in 2001, and won notoriety when he broadcast an explosive video that revealed the corruption at the heart of former President Alberto Fujimori's government, our correspondent says.
Opponents feared the influence he could wield in favour of coca growing from within the cabinet, he adds.
Peru, the world's second largest producer of cocaine, allows cultivation of about 10,000 hectares of coca, mostly in the Cuzco region, for its traditional uses as a medicine and tea.
Coca production rose by 14% in Peru last year, according to a United Nations report released in June.
The UN blamed the increase on a crackdown on coca cultivation in Colombia, which it says has fuelled cultivation in both Bolivia and Peru.