Italy's parliament has elected constitutional court judge Sergio Mattarella as the country's president.
Mr Mattarella, 73, will succeed Giorgio Napolitano, 89, who stood down earlier this month citing "signs of fatigue".
The result, confirmed on a third day of voting, will be seen as a boost for Prime Minister Matteo Renzi, who nominated Mr Mattarella.
Italy's president is largely a ceremonial role, but includes the power to appoint a prime minister.
That power is one quite frequently invoked in Italy, where politics is famously volatile.
Mr Napolitano named five prime ministers during his eight-and-a-half-years in office.
Analysis: James Reynolds, BBC News, Rome
Sergio Mattarella comes from a prominent Sicilian family which bears the scars of a painful fight against organised crime.
In 1980, the Mafia shot and killed Mr Mattarella's elder brother Piersanti, then the island's governor. Sergio Mattarella entered politics three years later, as a member of parliament for the now-defunct Christian Democrat party.
He later became a minister in several governments and once stood down in opposition to plans to make it easier for Silvio Berlusconi's media empire to expand.
Most recently. Mr Mattarella has been a justice of Italy's Constitutional Court. But he continues to be most well-known here as a politician and ally of the Prime Minister Matteo Renzi.
Sergio Mattarella's election to the presidency is widely seen as a significant political victory for the prime minister.
Mr Mattarella was elected after three inconclusive rounds of voting, in which no candidate secured the two-thirds majority needed to win.
Saturday's fourth round required merely a simple majority of the 1,009 eligible voters to produce a result.
Applause broke out in the Chamber of Deputies as Mr Mattarella's vote passed the 505-vote threshold.
He is expected to be sworn in next week.