The news means Spain has its first fully functioning government since December, when a general election left no party with a majority.
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 party and the Ciudadanos, as well as other regional parties.
Another general election was held in June but neither the PP nor the Spanish Socialist Party (PSOE) were able to gather enough support to govern.
If Rajoy, 61, had not won the parliamentary vote on Saturday a third general election would have been held in December.
Rajoy only won the vote thanks to the abstention of most lawmakers from the Socialist Party, which opted to let their arch-rival govern rather than go to third elections in poll-weary Spain. 170 lawmakers voted for Rajoy, 111 against and 68 Socialists abstained.
Once again Rajoy’s main challenge will be the Spanish economy, which managed to grow 3 per cent during the 10 months of political uncertainty.