By Ghaith Shennib and Marie-Louise Gumuchian
TRIPOLI (Reuters) - The head of Libya's national assembly said he was stepping down on Tuesday following the passing of a law banning anyone who held a senior post in Muammar Gaddafi's regime from government, regardless of their part in toppling the dictator.
In a televised speech to congress, Mohammed Magarief announced his resignation after the passage of the "political isolation" law, which critics and diplomats fear could strip government of experienced leaders, further complicating the transition to an orderly democracy.
"The people's representatives have expressed their word - the political isolation law - and it must be respected," he said, adding he was the first to conform to the new law, which comes amid worsening security in the North African country.
"I place my resignation in your hands. I leave with my head held high and my conscious clear."
The law was adopted on May 5 at the demand of armed factions who helped end Gaddafi's 42-year rule in 2011. Analysts fear the decision to hold the vote under duress could embolden armed groups to use force again to assert their will over congress.
The heavily armed groups had besieged two ministries before the passing of the law, which comes into effect on June 5 and prohibits former officials from holding any high position.
It does not make provisions for those who spent decades in exile and actually became instrumental in toppling Gaddafi.
An economist and former ambassador to India under Gaddafi, Magarief was born in 1940 in the eastern city of Benghazi, where the 2011 uprising broke out. He lived in exile from the 1980s and became a leading figure in Libya's oldest opposition movement, the National Front for the Salvation of Libya.
He was elected to the General National Congress on the ticket of the National Front Party, an offshoot of his old opposition movement, in Libya's first free elections for decades last July.
His tenure has not been smooth - protesters have stormed sessions several times as well forced the assembly out of its headquarters for a month.
In March, gunmen in a crowd of protesters calling for the new law shot at his car. This came after he survived a gun attack at his home in the remote desert south in January.
Armed violence and lawlessness caused in part by militia groups who often do as they please has hobbled governance in wide areas of the oil-producing state.
Magarief received a standing ovation from congress members after his speech, which touched on his exile and opposition to Gaddafi and which paid tribute to the former rebel fighters who ousted the dictator.
Congress members say the law could be applied to more than 20 people in the congress of around 200 members.
"We hope that all those who are affected by this law will follow what he has done," congress member Mohammed Amari said.
Congress spokesman Omar Hmaidan told reporters Magarief's first deputy Giuma Attaiga would be acting congress president until an election for a successor was held. Diplomats in Tripoli said it was still too early to identify any frontrunners.
In a sign of Libya's disarray, a group from the Tibu tribe blocked off the airport in the southern desert town of Sabha on Tuesday in protest at what they said was the disappearance of a local brigade leader, a military spokesman said.
"They gave the government a deadline and said that they would close the airport if they got no answers. They then did that and there are no flights leaving or landing at this time," Anas al-Barasi, a spokesman for the south's military governor, said by phone. No further details were immediately available.
(Writing by Marie-Louise Gumuchian; Editing by Alison Williams)