ROME — In his narrowest escape yet, Prime Minister Silvio Berlusconi barely survived a confidence vote on Friday, saving his government from collapse but leaving it all but incapable of legislating effectively.

With 316 votes for and 301 votes against, Mr. Berlusconi’s center-right coalition won the vote. But it failed to secure a solid majority, making it increasingly difficult for him to pass legislation aimed at protecting Italy from Europe’s sovereign debt crisis. Had he lost, Mr. Berlusconi would have had to resign, marking the end of an 18-year political era in which the billionaire businessman shaped Italian politics in his own image, entwining the country’s fate with his own.

In what the daily Corriere della Sera called “an atmosphere of interminable agony,” analysts said the Berlusconi government was now hanging by a thread and could fall at the next bump in the road — when enough disgruntled lawmakers from within Mr. Berlusconi’s coalition calculate that they would be safer jumping off a sinking ship rather than staying aboard and risking drowning.

Mr. Berlusconi called the confidence vote after failing to pass a routine measure this week. Addressing lawmakers on Thursday, the prime minister said he was the only “credible alternative” able to govern Italy through the economic crisis, and refused to step down.