- Mariano Rajoy was the caretaker prime minister and had served as PM before
- The economy remains a challenge, given Spain's unemployment rate of 19.5%
(CNN)Mariano Rajoy, Spain's acting prime minister and leader of its center-right Popular Party, was re-elected Saturday after winning a parliamentary vote.
The vote of 170-111 with 68 abstentions breaks a political deadlock and means Spain has its first fully functioning government since December, when a general election left no party with a majority.
The economy is once again Rajoy's major challenge.
The Brexit vote in the UK cast doubt on the future of the European Union. Spain's unemployment rate of 19.5% is the second highest in the EU after Greece.
But the economy has grown at a 3% rate despite having a caretaker government. Rajoy's austerity measures were a major factor in the turnaround.
After the December election Spain tried to put together a coalition government, but the process was complicated by the emergence of the left-wing Podemos and centrist Ciudadanos, as well as other regional parties.
Another general election was held in June but neither the PP nor the Spanish Socialist Party (PSOE), Spain's two major political forces, were able to gather enough support from a parliament that now represents 12 parties.
If Rajoy, 61, had not won the parliamentary vote on Saturday a third general election would have been held in December.
Rajoy was elected prime minister in 2011 by a landslide vote. His tenure has been tainted by allegations of corruption, which he has staunchly denied.