(Adds details on strikes, context)
By Ahmed Elumami and Patrick Markey
TRIPOLI, May 28 (Reuters) - Libya's acting prime minister, Abdullah Al-Thinni, on Wednesday refused to hand over power to a newly elected premier after questioning his legitimacy in a deepening confrontation among the OPEC nation's rival factions.
The North African state, struggling with unrest since a 2011 war ended Muammar Gaddafi's rule, now has two prime ministers and a parliament deadlocked by splits among Islamist, anti-Islamist and regional adversaries.
Thinni said he received conflicting orders from Libya's divided parliament over the legitimacy of Ahmed Maiteeq's election and would continue in his post until lawmakers in the General National Congress resolved the dispute.
"The conflict is mainly taking place under the roof of the congress," Thinni told a news conference. "I call on congress members to wisely discuss their dispute, step away from their interests, and to give priority to the interests of the country to avoid bloodshed."
Thinni referred to a justice ministry legal department ruling that Maiteeq's election was illegal. He said he had been told to hand over power by the parliament's president, but was ordered to stay in office by the congress's first deputy.
The GNC is at the heart of a growing confrontation among rival political parties and brigades of former rebels who refuse to disarm and have allied themselves loosely on competing sides of a split congress.
Gaddafi's authoritarian rule and three years of unrest have left Libya with few institutions and no real army to impose state authority on former fighters and Islamist militants who often use their military muscle to make demands.
Those rivalries have come closer to open confrontation this month after a renegade former general began a self-declared campaign with irregular forces to purge Islamist militants he says the government has failed to challenge.
Maiteeq, a businessman backed by independents and Islamist lawmakers, was appointed by GNC members after a chaotic vote contested by rival factions as illegitimate.
But shortly after his contested appointment, armed gunmen claiming loyalty to ex-general Khalifa Haftar attacked parliament to demand lawmakers hand over power to a commission of judges until elections later this year.
Complicating negotiations, another ex-rebel occupying key oil ports in a protest over local autonomy for his eastern region has also rejected Maiteeq's government.
The rebel, Ibrahim Jathran, had agreed with Thinni to end his port blockade and restart Libya's reduced oil exports. But Jathran says Maiteeq's election could scuttle that deal.
AIR STRIKES ON BENGHAZI
Haftar, a former Gaddafi ally who split with the leader in the 1980s, has irregular forces and some army units backing his campaign. He has touched a nerve among many Libyans fed up with instability and militant violence.
But rival militias, mostly allied with Islamist political factions, have accused him of attempting a coup and have said they will defend the parliament and the government.
On Wednesday, warplanes from an eastern air base bombed Islamist militia bases in Benghazi as part of Haftar's campaign, witnesses and officials said.
Two jets attacked a base belonging to the February 17 brigade, one of the Islamist-leaning irregular armed groups in Benghazi, and an Ansar al-Sharia militant base in the west of the city, a Reuters witness and an air force official said.
"Our forces are bombing the February 17 battalion base and Ansar al-Sharia base in Quarsha," Mohamed Hejazi, a spokesman for Haftar, told Reuters.
There were no immediate reports of casualties from local hospitals. A Reuters witness at the February 17 base said there were no casualties and only structural damage.
The February 17th Brigade is an Islamist-leaning irregular armed force linked to the defense ministry, one of scores of brigades of former fighters who once battled Gaddafi and now operate with semi-official status.
Libya's Ansar al-Sharia militant group, listed as a terrorist group by Washington, on Tuesday warned the United States against interfering in the country's crisis and accused the U.S. government of backing Haftar.
U.S. officials dismissed the claims. Ansar al-Sharia was accused of orchestrating the 2012 attack on the U.S. consulate in Benghazi in which U.S. Ambassador Chris Stevens and three other Americans died. (Writing by Patrick Markey; Editing by Andrew Roche and Eric Walsh)