Rome (CNN) -- Embattled Italian Prime Minister Silvio Berlusconi retained his position by a narrow margin Tuesday after the nation's upper and lower houses of parliament voted in favor of him in a confidence vote.
The vote in the upper house, or Senate, was 162-135 with 11 abstentions. The lower house, or Chamber of Deputies, turned in a much narrower margin -- 314-311, with two abstentions. The vote was the latest in a series on his leadership.
The last confidence vote for the three-term prime minister was in September.
With so many lawmakers aligned against Berlusconi, however, it may be difficult for him to carry on with his legislative program, said CNN's Dan Rivers.
"There is going to have to be a bit of horse-trading," he noted.
As the lower house vote total was announced, three loud explosions could be heard as protesters threw firecrackers or flash-bang devices at police lines assembled in the area, Rivers said. Several hundred protesters have amassed, and police had shut down a portion of central Rome.
There was no immediate reaction from Berlusconi. In a speech Monday to lawmakers, he made a last-ditch bid to save his political life.
"He who votes against us is betraying the mandate received from the electorate," Berlusconi said in his half-hour discourse.
"In these particularly hard times for our country, we all have to find a way to be united and do what is best for the country," he said, adding that "a crisis" was the last thing Italy needed now.
Berlusconi said he needed a mandate to complete judicial and institutional reforms and deal with the country's economic problems.
And he called on supporters of his rival, Gianfranco Fini, not to support the left by voting against him, saying they must not "subtract" votes from the right "in order to add them to the opposition."
Both Berlusconi's and Fini's parties are on the center-right. The prime minister threw Fini out of his party over the summer, and Fini took about 40 lawmakers with him to form the Future and Liberty Party.
On Monday, Berlusconi accused Fini, a co-founder of Berlusconi's People of Freedom Party, of betraying him.
And he reached out to the Christian Democratic Union, which is allied with Fini, for support.
Italian President Giorgio Napolitano, who has the authority to dissolve parliament, has said he opposes new elections because they would create instability at a time of economic crisis.
Last month, Fini accused Berlusconi of a lack of attention to the economic crisis and structural reforms that Italy needs.
Forbes magazine ranked Berlusconi last year as the world's 70th richest man, estimating his net worth at $6.5 billion. He amassed much of his wealth as a self-made media mogul, largely through the company Fininvest, and he also owns AC Milan, one of the world's most famous soccer teams.
He's known political instability before, having served twice as prime minister (1994-95 and 2001-06) before his election in 2008. Yet, especially in recent years, the 74-year-old has been dogged by scandal and legal troubles, in addition to his political challenges.
Those challenges include a bitter divorce from Veronica Lario, his wife of 19 years, after allegations that a businessman hired escorts for the prime minister and that Berlusconi attended a birthday party for an 18-year-old girl.
Videos released this fall showed Berlusconi joking about the Holocaust and calling a female opposition politician "Pig God." The Vatican's official newspaper blasted the remarks, calling them "deplorable" and calling the jokes blasphemous, anti-Semitic and sexist.
Shortly afterward, in October, Italian prosecutors expanded their tax fraud investigation into Berlusconi's Mediaset company, the nation's largest commercial broadcaster. The prime minister has dismissed the fraud charges as politically motivated.
Beyond his personal travails, there are the stark political challenges. Foremost among them, Berlusconi faces a difficult economic picture as he looks ahead to the rest of his term, which expires in 2013.
Italian unemployment is running at 8.5 percent, the highest level since 2003, according to the Italian statistical office, and public debt is 120 percent of the country's gross domestic product, the Bank of Italy says.