The winner of the country's top office was Giorgio Napolitano, an 80-year-old ex-Communist and senator-for-life who was the center-left coalition's choice for the job.
Napolitano garnered 543 votes - well above the minimum 505 necessary for victory - during the fourth round of balloting by some 1,000 electors, made up by lawmakers from the two houses of parliament plus regional representatives.
The result marked a victory for Prodi, who had to wait for the new president to receive the nod to form his Cabinet and had strongly supported Napolitano's candidacy.
But the process reflected deep divisions that emerged between the two blocs during a bitter electoral campaign and in the aftermath of the April 9-10 national elections.
Days of behind-the-scenes negotiations failed to produce a candidate both sides could agree on, even for a figure who, according to the constitution, represents the unity of the republic. Three previous rounds of voting where a two-thirds majority was necessary - as opposed to an absolute majority required Wednesday - ended with no victor.
Outgoing PremierSilvio Berlusconi rejected Napolitano on grounds that no center-left politician could represent all of Italy and be a guarantor of the constitution - even such a well-respected one as Napolitano.
Prodi was under intense pressure by the largest party in his coalition, the Democrats of the Left, to push for a candidate from its own ranks, as is Napolitano.
Berlusconi kept up his combative stance Wednesday, lamenting that his opponents had taken all the positions of power - a reference to the newly elected parliament speakers, also of the center-left. He urged Napolitano to be impartial.
"We hope that he carries out the role that the constitution assigns him with impartiality," he said minutes after the voting.
Prodi and other center-left leaders said Napolitano would be above the political fray and represent all of Italy.
The head of state is a largely ceremonial figure who wields some influence at times of government crises or political changeovers. Presidents have the power to dissolve parliament and call new elections, as well as the task to give mandates to form governments.
Napolitano is scheduled to be sworn in Monday afternoon, after the resignation by the current head of state, Carlo Azeglio Ciampi. Shortly afterward, Napolitano will meet with Prodi.
"I imagine the mandate will be given Tuesday evening or next Wednesday," Prodi said.
Once the government is formed, it must win a confidence vote in both houses of parliament. Prodi said he expected the vote in the Senate to be held by the end of next week and the final one in the lower house by May 23.
It will be the end of a political paralysis that has gripped Italy since the April election. Prodi won by narrow margin, and Berlusconi refused to concede defeat and alleged irregularities for weeks.
Adding to the stalemate was the need to elect a new president after Ciampi, who was ending his term, said he was leaving the task of giving Prodi the mandate up to his successor.
Prodi has been meeting with allies to define his Cabinet, and he is expected to have a list of ministers ready once he gets the nod. the AP reports.
After it turned out that Deputy Prime Minister Andrei Belousov included the Fonbet betting company in the list of backbone enterprises that can count on state support, everyone started talking about these bookmakers.