A rocket fired on December 25 by Fajr Libya (Libya Dawn), a coalition of Islamist-backed fighters, ignited the first fire which then spread to six other tanks at Al-Sidra oil terminal.
"The fires have been extinguished in all seven tanks that were ablaze after raging out of control for nine days," said Ali al-Hassi, security spokesman for the so-called "oil crescent" in eastern Libya.
Around 70 volunteer firefighters helped put out the flames with help from employees from local oil companies under tough conditions, while pro-government forces and militias fought nearby, Hassi said.
Al-Sidra is one of Libya's key oil terminal with Ras Lanuf and Brega also in the "oil crescent".
There are 19 storage tanks at Al-Sidra with a total capacity of 6.2 million barrels of oil.
Experts have said Libya's oil production dropped to less than 350,000 barrels per day from 800,000 previously, since clashes around the export terminals erupted on December 13.
Signup to our newsletter and follow us on Facebook and Twitter!
Fighters from Fajr Libya, which controls much of Tripoli, as well as second and third cities Benghazi and Misrata, have been trying to seize Al-Sidra and Ras Lanuf terminals.
Hassi said poke of "huge" losses encountered due to the fires, but gave no estimates.
On Monday, Libya's internationally recognised government approved a $6 million (4.9 million euro) deal with a US firm to send experts to extinguish the fires.
"At least that money has been now saved since we managed to put out the fires locally," said Hassi.
More than three years after dictator Moamer Kadhafi was toppled and killed in a NATO-backed revolt, the country remains awash with weapons and powerful militias, and has rival governments and parliaments.
The militias who had have been trying to seize control of the oil terminals have launched attacks from the city of Bin Jawad, east of Al-Sidra.
On Friday, Hassi said that Bin Jawad had been declared "a closed military zone" by the army command, ahead of an offensive against the militias.
"The Libyan army is preparing to launch a military assault to clean up the city of armed group who have been using it as a launchpad to attack oil installations," said Hassi.