The attack came as Islamist militias in the eastern town of Derna say they have formed a new coalition ahead of an expected assault by pro-government forces.
More than three years after a NATO-backed uprising ousted and killed long-time dictator Moamer Kadhafi, the country remains awash with weapons and powerful militias, and has rival governments and parliaments.
Islamists have seized Tripoli and second city Benghazi in the east, and forces loyal to international recognised Prime Minister Abdullah al-Thani are fighting to regain control of them.
Fighters from Fajr Libya, an anti-government Islamist coalition, attacked the Al-Hilal region from three sides on Saturday but the air force repelled them, said Brigadier General Saqr Jarushi.
"Air force jets and helicopters struck the fighters as they advanced on Al-Sidra oil terminal," he said, adding that the air raids had caused "a large number of casualties".
There was also fighting on the ground in which five government soldiers were reported wounded.
Earlier, Fajr Libya said it had launched an operation to "liberate oilfields and terminals" and that two of its fighters were killed and several wounded.
Al-Hilal is the location not only of Al-Sidra, but also of the Ras Lanuf and Brega terminals.
A state of emergency was declared, added Jarushi, who is part of anti-Islamist forces led by ex-general Khalifa Haftar battling for control of Tripoli and Benghazi.
Ibrahim al-Jadran, who heads a government unit in charge of guarding oil installations, said troops were still facing "some pockets of resistance".
ECONOMY HIT HARD
Signup to our newsletter and follow us on Facebook and Twitter!
Libya's economy took a heavy hit after rebels blockaded export terminals in July 2013, forcing a reduction in output and slashing vital oil revenues.
The seizure of four terminals as part of a campaign for restored autonomy for the eastern Cyrenaica region reduced output from 1.5 million barrels per day to just 200,000.
Under a deal with the government, the rebels returned control of two of the terminals in April and the remaining two in July.
In separate fighting, air forces loyal to Haftar attacked Fajr Libya elements west of Tripoli.
And in Derna, Islamists said they had formed a new coalition, the Mujahedeen Shura Council.
The Islamic State (IS) group that has seized chunks of Iraq and Syria is thought to have gained a foothold in Derna amid the chaos in post-Kadhafi Libya.
In its statement issued late Friday, the council called on everyone in Derna to join the new coalition.
It also addressed Islamist fighters in Benghazi, saying: "We are with you in the war against the criminal Haftar and his soldiers."
Ahead of the announcement, the Islamists staged a military parade in Derna, with tanks and combatants carrying black flags.
Western countries have been increasingly worried that the political turmoil could provide fertile ground for Islamic extremists.
A top US military general said last week that IS has set up training camps in eastern Libya and that the American military is closely monitoring the situation.
Analysts say a number of factions in Derna have pledged loyalty to IS, but it remains unclear how much support they enjoy.
Meanwhile, the United Nations is pressing the various factions to come together for peace talks, after an earlier bid in June to do so failed.