Italian president
Sergio Mattarella attends a meeting in Rome, in this April 22, 2007 file picture. Reuters/Remo Casilli

(Reuters) - Italian lawmakers elected Sergio Mattarella, a constitutional court judge and veteran center-left politician, as president on Saturday, handing a welcome political victory to Prime Minister Matteo Renzi.

Mattarella, speaking at his office in the Constitutional Court after the vote, said: "My first thoughts are of the difficulties and hopes of our citizens."

The election shows the 40-year-old Renzi in firm control of both his famously fractious party and his allies in the ruling majority as he seeks to pass reforms aimed at underpinning an economic recovery in Italy, where unemployment is soaring after six years of on-off recession.

After three inconclusive rounds of voting this week in which a two-thirds majority was needed, his candidate Mattarella was elected in the fourth round, when the required quorum fell to a simple majority.

As the ballots were counted out loud in the Chamber of Deputies, the 1,009 parliamentarians and regional officials eligible to vote burst into applause when Mattarella's name surpassed the 505-vote threshold, making him Italy's 12th president since World War Two.

Mattarella, 73, who is little known to most Italians, drew broad parliamentary support, garnering 665 votes. He is expected to be sworn in next week for a seven-year term, taking over officially for the 89-year-old Giorgio Napolitano, who resigned earlier this month.

"Keep up the good work, President Mattarella. Long live Italy!," Renzi tweeted after the vote. Even Pope Francis sent a congratulatory telegram.

The Italian president is a largely ceremonial figure, but he wields important powers at times of political instability, a frequent scourge in Italy, when he can dissolve parliament, call elections and pick prime ministers.

Center-right rival Silvio Berlusconi's Forza Italia party appeared in disarray after the vote.

Berlusconi ordered his party to cast blank ballots after accusing Renzi of betraying what he said was a promise to give him a role in choosing the candidate. Instead, more than 30 refused, opening a wound in the party.

Renato Brunetta, Forza Italia's chief whip in the lower house, said the pact that Renzi and Berlusconi sealed last year to make institutional reforms was dead, but not all his party colleagues were so resolute and Berlusconi himself has yet to comment.

"Renzi made a unilateral decision to break the pact," Brunetta said. "Nothing will be the same now."

SICILY

Mattarella is the first native of Sicily to become president. He has a reputation for being a reserved but straight-talking former minister, whose career in politics began after his brother, Piersanti, was shot dead by the Sicilian Mafia in 1980.

Mattarella's political roots are in Italy's defunct Christian Democrat party that his father Bernardo, an anti-fascist, helped to found after the war.

Though Mattarella is not seen as having vast international experience, he did serve as defense minister in two different center-left governments, from 1999 to 2001.

In 1990, Mattarella resigned as education minister to protest a decree that favored Berlusconi's media empire, and three years later he drafted a voting law, which has since been changed, that was used when Berlusconi won his first of three national elections in 1994.

(Additional reporting by Giselda Vagnoni and Isla Binnie, Editing by Angus MacSwan)