Haiti's President Michel Martelly and some of the country's opposition parties have struck a deal to hold new elections by late this year, aimed at defusing a political crisis that had the nation on edge.

However, Haiti's most hardline opposition party, Fanmi Lavalas, was not part of Sunday's last-minute agreement, which came shortly before the mandate of the sitting legislature in the impoverished Caribbean nation was to expire on Monday.

The leftist opposition party controls the majority of anti-government protesters and also key seats in parliament.

Trying to stem the unrest, Martelly played what might have been his last card and announced that a deal with some opposition parties had been reached.

- Gabriel Elizondo, Al Jazeera correspondent, reporting from Port-au-Prince

Al Jazeera's Gabriel Elizondo, reporting from Port-au-Prince, said the agreement struck by the president and parts of the opposition "was a deal perhaps in name only".

"Trying to stem the unrest, Martelly played what might have been his last card and announced that a deal with some opposition parties had been reached," Elizondo said.

Protesters accused Martelly of tacitly allowing the legislature to expire in order to rule by decree, while he accuses the opposition of blocking an electoral law that would allow a vote.

Political hurdles

But late on Sunday, just hours before the country marked the fifth anniversary of the earthquake that left some 300,000 people dead and devastated much of the capital, the president and some of the opposition politicians reached a long-term agreement.

The agreement states to have elections organised before the end of 2015 for two-thirds of the senate and deputies, as well as for president.

Separately, to improve faith in the system, a new nine-member electoral council will be created including representatives of the Catholic church and Protestant churches, as well as the local voodoo belief system, farmers' associations, women's and business groups, unions, the media and higher education.

Neither the government nor political parties are to be part of the electoral council, both sides agreed.

Meanwhile, a new consensus government is supposed to be set up to create the conditions needed for new, inclusive elections to be held.

Asked whether he was still fit to lead the country amid the ongoing political crisis, the president told Al Jazeera's Elizondo to focus on his accomplishments.

"I suggest that you tour the country and try to identify projects that we've been having in Haiti, efforts that we have done," Martelly said.

"How many kids have gone to school for free since I have become president? How many people have gotten out from under a tent since I became president? How many kilometres of roads have been paved? How many homes have been rebuilt? How the image of Haiti is changing around the world," the president added.

More protests against Martelly's rule were planned on Monday, as the country prepared for the five-year anniversary of the deadly earthquake.

Source: Al Jazeera and agencies