Peruvian Prime Minister Ana Jara was forced to step down after losing a vote of confidence in Congress on Monday.
Ms Jara was censured over allegations that Peru's intelligence agency had for years gathered information on leading figures in business and politics.
President Ollanta Humala must now select a new prime minister and cabinet.
It is considered the biggest crisis of his presidency since he took office in July 2011.
In Peru, the president is the head of the executive, but analysts say having his number two deposed by the opposition-dominated Congress is a sign of his waning influence.
A recent opinion poll by Ipsos suggested Mr Humala's popularity rating had dropped to 25%.
It is the first time in half a century that Peru's Congress has deposed a prime minister.
Congress voted 72 to 42 to censure Ms Jara, with two abstentions.
The move follows the publication on 19 March in the Correo Semanal weekly of a list of Peruvians who had allegedly been spied upon by the National Intelligence Directorate (Dini).
The list included opposition politicians, journalists, business people, members of the military and their families.
The spy agency reportedly accessed information from Peru's national registry of properties to gather intelligence on thousands of Peruvians.
The large number of people on the list angered opposition members of Congress.
Ms Jara sacked Dini's director as well as its counter-intelligence and national intelligence chiefs the day after the allegations emerged.
She also ordered a thorough investigation and denied she had ever ordered the surveillance or used the information gathered.
But in a debate on Monday, opposition members of Congress argued she had failed to control the spy agency and should therefore be removed from her post.
Members of the governing Peru Wins party said she had been made a scapegoat and denounced the move as a "political ambush".
Ms Jara was approved by Congress less than a year ago by a majority of only one vote, the sixth prime minister to serve under President Humala in his four years in office.
Her predecessor resigned amidst a corruption scandal after less than five months in the post.
President Humala will now have to name a new prime minister, who will then have to be approved by Congress.