— Greek Prime Minister George Papandreou narrowly won a confidence vote early Saturday morning, setting Greece on a path toward a unity government that will seek to steer the country through its financial crisis before new elections are called next year.

The vote leaves Europe’s efforts to combat its debt crisis on more solid ground after five dramatic days in which it appeared that Greece could leave the euro zone. Instead, Europeans may have a stronger Greek partner within days, although analysts said that the tumult probably damaged plans to bolster the euro zone’s rescue fund.

Saturday’s early morning vote capped an extraordinary week of uncertainty, in which top European leaders said for the first time that they would cast a country out of the euro zone if it failed to live up to its obligations, adding a potent new weapon to their tools for scaring nations into economic good behavior.

That move forced Greek politicians to unite around a biting austerity plan to get their country’s economy onto a sustainable track. Italy, too, announced Friday that it would allow the International Monetary Fund to come and watch its progress in reform, an unusual step.

But Greece’s political turmoil was not yet over. Papandreou’s move to create a unity government, which was forced by his own deputies, left open the question of who would run it. Moreover, the head of the main opposition party has said that he did not want to govern jointly with the ruling Socialists if Papandreou remains the leader.

Parliament will also have to approve the bailout plan, although that appears assured. That will clear the way for the $11 billion installment of bailout money that Greece needs to avoid default by mid-December.

“I don’t care if I’m not elected prime minister again,” Papandreou told Parliament before the vote. “The time has come for a new effort. A good-faith effort on a basis that will create trust.”

The timing of the formation of the government remains unclear, but several deputies said earlier Friday that they hoped Papandreou would step down within days, once he had resolved plans for his successors. He made no clear commitment to stepping down in his comments before the vote. Finance Minister Evangelos Venizelos — one of Papandreou’s top rivals in the party, who has made moves to assert leadership in recent days — called for March elections.

Papandreou, 59, whose father and grandfather were also prime ministers of Greece, came to power in 2009 only to discover that the country’s finances were far shakier than his predecessors had acknowledged.

When he disclosed the bad news, he helped fuel the debt crisis that has shaken Europe for the last two years.

Greece’s own drama culminated this week, when Papandreou shocked world leaders by calling for a referendum on the tough bailout measures set last week, only to be forced to retreat after his own party abandoned him, fearing that he could spark a far worse crisis with the uncertainty.

In the end, all 152 Socialist deputies supported him in the confidence vote, along with another former Socialist.

A transitional government “could help diffuse all this tension,” said George Pagoulatos, a professor of politics and economics at the Athens University of Economics and Business.

Greece has long been just a component of a much larger problem facing Europe: how to steer the continent through a reckoning after years in which euro-zone countries were treated as equally able to repay their debts, even though they had deeply divergent economies.

The week’s events both helped and hurt that response, analysts said.

The continent’s top leaders now acknowledge that countries can be kicked out of the euro zone if they cannot meet the fiscal demands of taking part, which can scare politicians into compliance but can also spook investors and even worsen the problem, analysts said.

“It’s a very risky thing,” said Jacob Kirkegaard, a fellow at the Peterson Institute for International Economics. “This is a threat that could potentially very seriously backfire . . . there is a difference, all of a sudden, between an Italian and a German euro.”

Still, he said, the political pressure of the new threat of expulsion should be enough to help struggling countries like Italy carry out difficult reforms.

Both Italy and Spain have been struggling with their debts, and leaders and investors worry that Europe’s bailout fund isn’t big enough to help both of them if they need it.

Italy, in particular, has struggled under Prime Minister Silvio Berlusconi to muster the political will to make difficult cuts.

Papandreou’s apparent end may hasten Berlusconi’s own, analysts said, and it appears to have stiffened Italy’s will to reach a more extensive reform program.

Italy’s borrowing costs have rocketed in the last week above the 6 percent level that economists treat as a warning sign that its debts may soon spiral out of control. Those costs were likely worsened — not helped — by the Greek bailout plan agreed to last week.

Private investors were pushed into writing off half of what Greece owed them — and since it was nominally voluntary, the insurance that serves as protection against such defaults wasn’t triggered.

In practice, that means that all such insurance is likely worthless, analysts said — leading to higher borrowing costs for risky countries.

In a surprise step this week, the European Central Bank announced that it would lower interest rates to help combat an emerging recession, a move that means that it fears that the euro zone’s economic outlook is worsening but that it is willing to take steps to fight it.