The Italian parliament on Saturday re-elected 87-year-old President Giorgio Napolitano to serve a second term in an attempt to resolve the political stalemate following February's inconclusive election.
Napolitano was overwhelmingly elected by the 1,007 parliamentarians and regional representatives in a sixth round of voting after they had failed to find a mutually acceptable candidate in the previous attempts.
He is now expected to push for a broad coalition government.
As most of parliament cheered his re-election, a group of around 500 demonstrators protested outside, with a much larger rally planned later in the day.
In normal circumstances the presidency is a largely ceremonial position, but at times of political instability the president plays a crucial role in forming a government and has the power to dissolve parliament.
Napolitano is one of the world's oldest heads of state and the fact that most of the main political forces virtually begged him to continue despite his numerous previous refusals shows the depth of the current impasse.
In almost two months since the election, Napolitano has failed to broker a solution to the gridlock that emerged from the February election which left no coalition with enough seats in parliament to form a government.
A broad coalition has so far been rejected by the center-left, which won most seats at the election and refused to join forces with Berlusconi's center-right.
However, Napolitano now has the power to call fresh elections, which he did not have in the final months of his current term. Most on the center-left fear new elections so they may now be more willing to come to terms with Berlusconi.
"I feel obliged to offer my availability as requested," Napolitano said in a statement. "I cannot shun my responsibility towards the nation."
Earlier in the day, center-left and center-right leaders Pier Luigi Bersani and Silvio Berlusconi, and caretaker Prime Minister Mario Monti who heads a centrist group, all went to his palace to ask him to carry on as the only way of breaking the deadlock.
He has been formally elected for a full seven-year term but most commentators believe that once the present political crisis is resolved, he will probably resign within a year. No president has ever been elected for a second term.
Tensions in the country are running high. Ordinary Italians are struggling with recession, falling living standards and rising unemployment and center-left voters in particular have looked on aghast at developments since the election.
The main center-left Democratic Party (PD) is in chaos after scores of rebels took advantage of the secret ballot to sabotage the party's official candidates in previous presidential votes.
PD leader Bersani announced late on Friday that he would quit after the new president was elected, leaving the largest force in parliament rudderless and making prospects for broader political stability looking even weaker.
The leader of the anti-establishment 5-Star Movement Beppe Grillo called on "millions" of Italians to join him in protest outside parliament later on Saturday against Napolitano's re-election which he called a "coup d'etat."
The traditional parties he blames for Italy's economic decline and corruption have already agreed to govern together in a broad coalition to preserve the status quo, he said on his blog.
The area around parliament was already cordoned off by police ahead of the rally, and a sizeable crowd was gathering.
His words were condemned by mainstream politicians, some of whom said his language and planned protest was reminiscent of wartime dictator Benito Mussolini's "march on Rome" which marked his rise to power in 1922.
For several days a small group of protesters have gathered outside parliament, chanting in favor of the 5-Star's presidential candidate Stefano Rodota.
Rodota, a 79 year-old left-wing academic, called for moderation on Saturday, saying any protests must be peaceful.
Grillo's movement rode a huge protest vote to become one of three main forces in parliament, driven by frustration at economic hardship and a discredited political class.
The transformation in the fortunes of Bersani, who three months ago seemed the likely next prime minister, underlined uncertainty over how a deeply-divided political class can implement much-needed reforms to tackle an economy that has stagnated for the last 20 years.
There will now be a leadership battle in the PD, founded to unite a range of smaller leftist and centrist parties in 2007.
Bersani's departure could make way for his arch-rival the 38-year old mayor of Florence Matteo Renzi, who has wide public support but is viewed with suspicion by the old PD hierarchy.