PORT-AU-PRINCE, Haiti (AP) – Haitian lawmakers on Sunday chose the country’s Senate chief to lead a caretaker government that will fill the void left by last week’s departure of former President Michel Martelly and perhaps ease lingering tensions that recently pushed the deeply polarized nation into political crisis.

In the early hours of Sunday, Jocelerme Privert was elected as provisional president and sworn in after a plodding session by Haiti’s bicameral legislature. The veteran politician was one of three candidates vying to lead an interim government that’s supposed to last only 120 days.

His new position will be that of a powerbroker who hopefully carries enough weight to quickly smooth political divisions that have left Haiti without an elected president chosen by voters or a completed Parliament due to suspended elections. Prime Minister Evans Paul remains in office for now, but Privert and lawmakers are expected to confirm a No. 2 official in coming days.

During a speech to lawmakers hours before their final vote, Privert vowed to lead a caretaker administration that would “foster confidence within all sectors of society,” ensure stability and see that suspended elections are held “as soon as possible.”

He became interim president after 3 a.m. EDT (0800 GMT) following a second round of voting that put him over the top with 13 votes from senators and 64 votes from lower house deputies. The tally shifted significantly in his favor after closed-door negotiations following an initial round that gave Privert just two votes more than rival Edgard Leblanc, a former Senate president who was being backed by Martelly’s political faction.

Martelly, who was barred by Haiti’s constitution from seeking a consecutive term as president, departed office a week ago without a new elected leader in place. A runoff presidential election was delayed for a second time last month amid violent opposition protests and deep public suspicions about vote rigging in favor of his chosen successor.

Less than 24 hours before Martelly was set to step down, top Haitian leaders managed to cobble together plans for a short-term provisional government and a roadmap to hold the postponed presidential and legislative runoff. As Senate chief, Privert was a central figure in those talks.

Privert, who was scheduled to be formally installed later Sunday, faces an uphill battle in bringing the troubled country and its perennially feuding politicians together. In recent days, some demonstrators took to the capital’s streets to protest against Privert’s inclusion as a candidate for provisional president, while others marched to support him.

His elevation to Haiti’s interim leader is a dramatic transformation for Privert, who was jailed for over two years at the start of Haiti’s last provisional government in 2004. Charges that were eventually dismissed alleged the former Cabinet minister orchestrated a massacre of former President Jean-Bertrand Aristide’s opponents during the buildup to an armed rebellion, but Privert always maintained he was a political prisoner and had no involvement in any killings.

Privert recently told The Associated Press that a new electoral council will be created soon to ensure that the postponed runoff is fair and transparent. That vote is tentatively scheduled for April 24, but Privert has stressed that the next council is responsible for confirming the date and all other electoral matters.