(Adds counter claim, details, background)

By Ayman al-Warfalli

BENGHAZI, Libya, Sept 18 (Reuters) - A Libyan force ousted a week ago from key oil ports counter attacked on Sunday, taking back control of Es Sider terminal and triggering clashes near Ras Lanuf port, a spokesman for the force, Ali al-Hassi, and a port worker said.

Es Sider and Ras Lanuf were among four ports seized by forces loyal to eastern commander Khalifa Haftar's Libyan National Army (LNA) on Sept. 11-12 from a Petroleum Facilities Guard (PFG) faction led by Ibrahim Jathran.

Control of the ports remained unclear though with the LNA saying it repelled PFG forces at one port. But the fighting came as the state-run National Oil Corporation prepared to restart oil exports at the ports that have been closed for nearly two years by clashes among rival armed factions.

A spokesman for a guard force loyal to the LNA, Miftah Magariaf, said Jathran's PFG had been repelled from Ras Lanuf with the help of LNA air strikes and that LNA-aligned forces were preparing to recapture Es Sider.

An LNA official said there was a fire at a tank in Es Sider.

The LNA's seizure of the ports took place as the Muslim holiday of Eid was starting and faced little resistance, with a senior tribal leader calling on Jathran's men to switch allegiances.

After moving into Es Sider, Ras Lanuf, Zueitina and Brega, the LNA said it was handing over control of the terminals to the National Oil Corporation (NOC) so that exports could resume.

Jathran had long blockaded the ports of Es Sider, Ras Lanuf and Zueitina, and a recent deal between him and the U.N.-backed government in Tripoli showed little sign of progress.

On Thursday, the NOC announced it was lifting "force majeure" contractual clauses at the blockaded ports and that exports would restart immediately at Zueitina and Ras Lanuf.

It said they would start as soon as possible at Es Sider, and would continue at Brega, which had remained open.

Conflict since Libya's 2011 uprising has reduced its oil output to a fraction of the 1.6 million barrels per day the OPEC member once produced.

(Additional reporting by Libby George; Writing by Aidan Lewis; editing by Patrick Markey) ((Aidan.Lewis@thomsonreuters.com ; +216-29850352;))