The 73-year-old Sicilian, who was backed by Prime Minister Matteo Renzi's centre-left Democratic Party (PD), succeeds the hugely popular Giorgio Napolitano, who is stepping down because of his advanced age.
"My thoughts are, first and foremost, on the difficulties and hopes of our citizens," Mattarella said in a brief appearance.
Renzi, for whom the election was a political victory, rejoiced in a Tweet: "Good work, President Mattarella! Long live Italy!"
By choosing an austere, left-leaning social democrat Renzi unified his party, but also showed disgraced former prime minister Silvio Berlusconi, an ally in important reforms, he was no longer essential.
Also Read
Renowned for his integrity, he entered politics after his elder brother was murdered by the Sicilian Mafia.
Mattarella won 665 votes in the fourth round of voting by a 1,009-member electoral college, composed of members of the two houses of parliament -- the Senate and the Chamber of Deputies -- and 58 representatives of the regions.
Ferdinando Imposimato, the candidate of the anti-establishment Five Star Movement of Beppe Grillo, won 127 votes.
As the ruling party's candidate Mattarella had support from most of the 415 PD politicians in the electoral college as well as several allied lawmakers.
But Italian presidential elections are nothing if not unpredictable, meaning the vote was not devoid of suspense.
In 2013, Romano Prodi was the favourite to succeed Napolitano, but a revolt within the PD scuppered his chances and blocked a decision, forcing Napolitano to agree to start a second mandate which he always insisted he would not finish.