Mehdi Karrubi, a top Iranian opposition leader who has been under house arrest for nearly six years, has resigned as secretary-general of his party.

Karrubi wrote in a letter to the National Trust party that his resignation is an effort to preserve unity ahead of the May presidential election.

"Considering my situation since [2011] and given that I do not know how long this will last, I ask my friends to accept my resignation," wrote Karrubi, according to the reformist newspaper Shargh.

His son, Hossein Karrubi, confirmed his father's resignation.

Karrubi, 79, and Mir Hossein Musavi were reformist candidates and leaders of the Green movement in the controversial 2009 presidential election.

Less than two years after questioning the victory of hard-line candidate Mahmud Ahmadinejad and leading mass protests in Iran, both leaders and their wives were put under house arrest for what officials call "the sedition."

The National Trust party was banned after the election.

Karrubi, Musavi, and their supporters have repeatedly asked for the two leaders to be tried in court, but officials have thus far refused.

Sadegh Larijani, the conservative head of the judiciary, said on December 26 that the "sedition dossier is still open and will be examined."

Iranian President Hassan Rohani, a relative moderate, had promised during his 2013 campaign to secure the release of Karrubi and Musavi.

With reporting by AFP and Trend