Former communist Giorgio Napolitano has been elected president of Italy, clearing the way for the creation of a new government.
Mr Napolitano is the country's 11th post-war president
The 80-year-old won an absolute majority of 543 votes out of a possible 1,009 after a fourth round of voting.
Mr Napolitano was the chosen candidate of incoming PM Romano Prodi, but faced opposition from the conservatives.
Mr Prodi has decided on his key cabinet positions and says he will be ready to govern within several days.
Mr Napolitano is the country's 11th post-war president and a well-respected figure from the Democrats of the Left, the biggest party in Mr Prodi's coalition, says the BBC's Christian Fraser in Rome.
Mr Prodi, who narrowly won parliamentary elections last month, says Mr Napolitano will be sworn in next Monday and that he will be given a mandate for his new government that Wednesday.
This probably means that the week after, they will have a vote of confidence in both houses for Mr Prodi's new government, our correspondent says.
Members of the electoral college of legislators and regional representatives who elected Mr Napolitano rose to applaud him as he reached the majority of votes needed for election - well above the minimum 506 necessary.
"I am very satisfied, because the number of votes was the most we expected. I believe that the centre-right opposition has lost a chance to join us, because Napolitano will be the president of all Italians," Mr Prodi said.
Italy's head of state - basically a figurehead - is elected by 1,010 grand electors, including MPs from both houses and representatives of 20 local regional governments.
Mr Napolitano, a life senator, was interior minister in Mr Prodi's 1996 government, which are largely the reasons outgoing PM Silvio Berlusconi has refused to endorse his candidacy.
The outgoing president, Carlo Azeglio Ciampi, has said he will stand aside early.