Silvio Berlusconi, the Italian prime minister, has told the country's president that he will resign after the new budget law currently making its way through parliament is approved, the head of state's office said in a statement.
The budget law is expected to be passed by the end of this month, but its passage might now be accelerated.
President Giorgio Napolitano said Berlusconi was aware of the consequences of a vote on crucial budget measures in parliament on Tuesday in which his centre-right coalition failed to secure a majority in the lower house.
Berlusconi's government obtained only 308 votes, falling short of an absolute majority of 316 in the 630-seat lower house as former coalition allies and even some members of Berlusconi's own party voted against the government.
However, the measures, part of a package of reforms demanded by other eurozone members as part of efforts to tackle Italy's debt mountain, were passed as opposition deputies abstained from voting.
In a dramatic shift from his usually defiant tone, Berlusconi conceded late on Tuesday that he no longer had a parliamentary majority and would step aside for the good of the country.
"The markets don't believe that Italy is capable, or has the intention of approving these reforms,'' he told his private Mediaset television, confirming the president’s statement.
"Things like who leads or who doesn't lead the government" was less important than doing "what is best for the country," he said.
Napolitano's statement made no mention of the possibility of elections, but Berlusconi said he thought that was the best solution. Berlusconi had previously said he wouldn't run for a fourth term, but nothing would preclude him from presenting himself as a candidate.
Clinging on to the last hour
True to form, Berlusconi was struggling to retain power right up until the last minute, Al Jazeera's Tim Friend reported.
"At one point, the cameras picked up a note that Berlusconi had written to himself in parliament and it said 'traitors'. Clearly that's the way he sees it," our correspondent said.
"We understand that even until the end, even during his meeting with the president, he was trying to hold on to power."
In his hour-long meeting with the president, Berlusconi had noted the urgent necessity of seeing the new budget law approved in parliament, according to the statement.
"Once this engagement is fulfilled, the prime minister will hand in his mandate to the head of state who will proceed with appropriate consultations, paying close attention to the positions and proposals of all political forces," the president said.
The departure of the 75-year-old billionaire media magnate comes after corruption trials and sex scandals, with Italy's spiralling economic crisis striking the final blow to his attempts to stay in power.
Italy has displaced Greece as the epicentre of the eurozone's sovereign debt crisis, with government bond yields nearing unsustainable levels that could force the bloc's third largest economy to seek a bailout that Europe cannot afford.
Analysts say there are three broad possible scenarios that could follow Berlusconi's departure: an expansion of the current centre-right coalition, the creation of a national unity government, or early elections.
Under the first scenario, Berlusconi could hand over the reins of government to one of his close aides like Angelino Alfano, head of the ruling People of Freedom (PDL) party, or Gianni Letta, the cabinet secretary.
In the second scenario, the new prime minister could be a high-profile technocrat such as Mario Monti, a respected former European commissioner who is currently dean of Bocconi University, Italy's leading economic research hub.
If no new working majority can be negotiated, then President Giorgio Napolitano would be forced to dissolve parliament and call early parliamentary elections before the official end of the government's mandate in 2013.