TRIPOLI — Warplanes from Libya’s internationally recognized government Monday attacked an airport in Tripoli, the capital controlled by a rival administration, officials said.

Extending a series of tit-for-tat strikes, the attack coincided with the swearing-in of Khalifa Haftar, one of the most divisive figures in post-revolutionary Libya, as army commander for the recognized government.

In a speech, Haftar vowed to continue a “fight against terrorism,” according to a video from the ceremony posted on social media. “We remind the world that our army is fighting terrorism on its behalf.”

Rival governments and parliaments are battling for control of the large North African country and its oil resources four years after rebels ousted veteran autocrat Moammar Gadhafi.

The recognized Prime Minister Abdullah al-Thinni and the elected parliament have been confined to the remote east since an armed faction seized Tripoli last summer, reinstating the previous assembly and setting up a rival administration.

“Warplanes conducted airstrikes this morning on Mitiga airport but there was no damage,” airport spokesman Abdulsalam Buamoud said. “Flights were suspended for only an hour … but now the airport is working normally.”

Mohamed al-Hejazi, spokesman for forces loyal to Thinni, said they had attacked the airport “because it’s outside state legitimacy. … Weapons and foreign fighters bound for western Libya pass through the airport.”

Both sides are aligned with rival armed factions which have been fighting over territory and oil facilities while Islamist militants have exploited the chaos to carve out fiefdoms.

To add firepower to small army forces loyal to Thinni, the eastern government and parliament have formed an alliance with Haftar, who began a self-declared war against Islamist militants in Benghazi, Libya’s second biggest city, last year.

Haftar gained support from some Libyans tired of their country’s disorder, but also drew criticism over airstrikes and attacks on civilian airports and seaports.

The Tripoli-based rival government has denounced Haftar as “war criminal” whose appointment as army commander would complicate mediation efforts by the United Nations.

The United Nations has been trying to persuade both sides to form a national government and said on Saturday that progress had been made. But both factions face internal divisions.

Haftar did not mention the U.N. dialogue in his speech, saying instead, “We convey our thanks and appreciation for countries supporting the Libyan army, especially Egypt, its leaders and people.”

The Tripoli government, which Thinni’s government says is backed by radical Islamists, says Egypt is providing weapons and ammunition to Haftar, something he denies.