BENGHAZI, Libya (Reuters) - Rival Libyan forces carried out tit-for-tat air strikes on oil terminals and an airport on Tuesday, escalating their battle for control of the oil-producing country days before United Nations peace talks are to resume in Morocco.

Islamist militants, who have gained ground in Libya's turmoil, on Tuesday also took over Libya's Bahi oil station and the Mabrouk oilfield, after forces guarding the installations were forced to retreat from the empty operations.

The United Nations called for hostilities to end before negotiations it hopes will stop fighting between Libya's two rival governments four years after the fall of Muammar Gaddafi.

Oil installations and key infrastructure are prime targets in the conflict, pitting Prime Minister Abdullah al-Thinni's internationally recognized government against Libya Dawn, the group which took Tripoli last year and formed its own administration.

A warplane belonging to forces allied to Libya Dawn bombed the oil ports of Ras Lanuf and Es Sidra, causing minor damage, according to a security official with Thinni's government.

"The rockets fell near the tanks, resulting in only minor damage," said Ali Hassi, a spokesman for the forces guarding Libya's oil infrastructure.

Islamic State

Es Sidra and Ras Lanuf, which make up half of Libya's oil output when operating normally, shut down in December due to the conflict. Libya currently produces around 400,000 barrels of oil per day, compared to 1.6 million bpd before Gaddafi was toppled.

Warplanes also hit Maitiga, Tripoli's airport, air force commander Saqir El-Jaroshi said. There were plans for strikes against the airport of port city Misrata, a base of Libya Dawn.

Jaroshi said the strikes were retaliation for Tripoli forces bombing Zintan, a town loyal to Thinni's government, and to stop suspected supplies to Islamist militants.

A source at Maitiga said a warplane struck near the runway but did not cause major damage. Most international airlines stopped flying to Libya and foreign diplomats were pulled out as fighting worsened last year.

Security spokesman Hassi said Islamist militants had taken over the Bahi oil pumping station and Mabrouk oilfield. Both operations were empty, their staff evacuated.

A spokesman for the National Oil Corporation did not respond to requests for confirmation. When it was operating, Mabrouk produced around 40,000 barrels a day of crude.

Militants in Libya claiming ties to Islamic State in Iraq and Syria have carried out high profile attacks which have raised fears the country has become a haven for extremists, just across the Mediterranean from mainland Europe.