The Italian Parliament elected Sergio Mattarella as the country’s president on Saturday at its fourth attempt.

In the previous three rounds, which took place on Thursday and Friday, none of the candidates managed to gather two-thirds majority or 673 votes.

It was expected that Mattarella will be elected in the fourth round, at which only a simple majority of 505 votes is required, ANSA news agency reports.

Mattarella, who was proposed by Prime Minister Matteo Renzi and his Democratic Party, had previously served as Deputy Prime Minister, Minister of Education and Minister of Defence.

Mattarella becomes the twelfth president of Italy, succeeding Giorgio Napolitano, who resigned earlier in January due to his old age and poor health.

Mattarella who started his career as a judge from Sicily, entered politics in 1980 after his brother was assassinated by the Mafia, the Financial Times reports.

Mattarella was one of the architects of Italy’s electoral laws in the 1990s, rising to become a judge at the constitutional court in 2011.

Although Italian governments are run by the prime ministers, the presidents also have considerable powers, especially in times of crisis.

According to the constitution, the president has powers to dissolve parliament, call new elections and influence the formation of new governments.

It is believed that the election of Mattarella will be beneficial for PM Renzi, as it is to restore confidence in his government and consolidate the support of his Democratic Party.