Rajoy was guaranteed to pass the vote after his Popular Party gained an absolute majority in Parliament thanks to a landslide victory in Nov. 20 elections won on promises to lift Spain out of its economic crisis. He received the support of 187 deputies in the 350-seat lower house, while 149 deputies voted against and 14 abstained.
Rajoy's party colleagues immediately gave him a standing ovation while outgoing Socialist premier Jose Luis Rodriguez Zapatero crossed the camber to congratulate him.
"I feel happy because it comes after many years of defending the ideas I believe in," Rajoy said after the vote. "To win the backing of the Spanish people is really comforting but it also entails an enormous responsibility with regards to the future.
"I know that things are not easy and they are going not be difficult but I am enthusiastic and hopeful and am determined to lead Spain forward," he added.
Rajoy will formally be sworn in before King Juan Carlos on Wednesday. He is then to name his ministers and hold a first cabinet meeting on Friday.
The economic news, meanwhile, was somewhat comforting, with the Treasury reporting strong interest for short-term debt. It sold €5.6 billion ($7.3 billion), way above the €4.5 billion it had initially sought.
Investors demanded an interest rate of only 1.74 per cent to lend the government 3-month money, down sharply from 5.1 per cent in the last such auction on Nov. 22. The rate for the 6-month bills was 2.44 per cent, down from 5.22 per cent.
Short-term credit conditions have eased significantly in recent weeks, helped by the European Central Bank's offer of ultra-cheap loans to the financial sector as well as the promise by eurozone governments to accept tighter controls on their budgets.
Spain has already made sharp cuts to its national spending to convince bond investors it will remain solvent despite the turmoil in European financial markets — and Rajoy intends to pursue more austerity.
Opening the investiture debate Monday, Rajoy promised austerity cuts worth €16.5 billion ($21.6 billion).
The collapse of a real estate bubble in 2009 ushered in a near two-year recession that has left Spain with an unemployment rate of 21.5 per cent — the highest in the euro-zone — as well as a swollen deficit and a stalled economy.
Since then, Spain's borrowing costs have spiraled amid fears it might need a bailout like Greece, Ireland and Portugal.
Rajoy said he would bring in reforms to encourage companies to hire and tax breaks for small and medium-sized firms that make up the bulk of the economy. He says he will also streamline the government with a hiring freeze for most groups of civil servants.