Mattarella, 73, was chosen by more than 1,000 lawmakers and regional representatives in the fourth round of voting, after three inconclusive votes in the past two days. Mattarella's vote passed the 505-vote threshold.
"Good job, President Mattarella! Long live Italy," Italy's Prime Minister Matteo Renzi said on his Twitter account.
Italy's previous president, Giorgio Napolitano, 89, resigned earlier this month. His term was supposed to last until 2020.