* Deadline passes but militias say their troops ready
* Assembly mandate expired earlier this month
* GNC president says army will defend its legitimacy (Adds troop buildup near parliament, details)
By Ghaith Shennib and Ulf Laessing
TRIPOLI, Feb 18 (Reuters) - Two heavily armed Libyan militias demanded on Tuesday the country's parliament hand over power immediately in what the head of the assembly dismissed as an attempted coup that would be confronted by the army if necessary.
Tuesday's deadline of five hours from the statement issued by the al-Sawaiq and al-Qaqa militia brigades passed without incident but they said they had troops on standby to force the hand of the General National Congress (GNC).
"We will act soon and hand over power to the supreme court and form committees to oversee elections," al-Qaqa top commander Othman Mlekta told Reuters. "We will work with the people and we're in contact with people in the south and east."
There was no sign of unrest on Tuesday evening in Tripoli but dozens of vehicles armed with anti-aircraft guns from the Qaqa militia were parked at a roundabout near the GNC building.
A commander told reporters the militia had been prepared to move to the assembly and arrest deputies but extended their deadline by two days after talks mediated by the United Nations.
The U.N. mission in Libya could not be immediately reached for comment but the reporter could see a senior U.N. official standing next to the militiamen.
In another show of force, some of Mlekta's troops had earlier travelled in armoured cars along Tripoli's airport road.
In a separate protest underscoring the volatility of the OPEC country, security guards forced Benghazi airport in the east to close for six hours to demand salary payments.
COUP ATTEMPT REJECTED
Both militia threatening the GNC are among the most experienced ex-rebel groups that helped topple dictator Muammar Gaddafi in the uprising that began three years ago this month.
Their threats are among the most serious made against the parliament, which has previously been stormed by an ex-rebel group demanding a greater share of power.
"In our view, the GNC stands for a return of dictatorship," a militia spokesman said in a statement read out to journalists, giving its deadline after the GNC's mandate expired this month.
Libya is grappling with chaos across the country as the government of Prime Minister Ali Zeidan struggles to control the militias who helped overthrow Gaddafi but have retained their weapons to shape post-war politics.
Many Libyans blame the militias and GNC infighting for a lack of progress in the transition towards democracy.
GNC President Nouri Abusahmain rejected the militia statement as a coup attempt.
"The GNC has given instructions to the chief of staff to take the necessary steps to deal with this group," he told a televised session of parliament. "The GNC received confirmation from the head of the army and revolutionaries that they would defend its legitimacy."
BENGHAZI AIRPORT CLOSED
Tensions have increased over the GNC's role after its initial mandate ran out on Feb. 7. Deputies agreed to extend their term in office to allow a special committee time to draft a new constitution but their move has triggered protests.
On Monday, it announced new elections soon but gave no date.
The GNC is deeply split between the National Forces Alliance party and the Islamists of the Justice and Construction Party tied to the Muslim Brotherhood, and the Al Wafaa bloc.
Oil production, Libya's lifeline, has slowed to a trickle as protesters and tribesmen have seized oil ports and fields across the vast desert nation to press political and financial demands.
Output fell to 375,000 barrels a day due to a pipeline protest, a spokesman for state National Oil Corp (NOC) said. In July output was 1.4 million bpd.
In the eastern capital Benghazi, members of the armed unit in charge of protecting the airport blocked the runway and prevented staff from entering the passenger terminals for six hours, according to an airport official.
The guards said they had not received their salaries for several months, the official said, and also wanted full disclosure into the circumstances of a recent helicopter crash.
The protesters allowed the airport to reopen after officials promised to look into their demands, the official said. (Reporting by Feras Bosalum, Ayman al-Warfalli, Ghaith Shennib and Ulf Laessing; Writing by Ulf Laessing; Editing by Tom Heneghan)