Citing security concerns, the federal government announced early Tuesday Canadian staff have been temporarily removed from offices in Libya.
"Due to operational challenges, including the unpredictable security environment in Tripoli, we have authorized the temporary suspension of operations at our office in Tripoli," Foreign Affairs Minister John Baird and Minister of State for Foreign Affairs and Consular Lynne Yelich said in a joint statement.
Canadian staff and diplomats will work out of the embassy in Tunisia for now.
"This decision is solely due to concerns about the security of our personnel and has no connection with our continuing and long-standing diplomatic relations with Libya. Canada remains committed to supporting Libya's democratic transition, and we urge all parties to stop the violence and resolve their differences by peaceful and democratic means," the statement said.
Foreign Affairs currently advises against all travel to Libya.
Libyan forces on Tuesday battled Islamist militants with rockets and warplanes for control of an army base in the eastern city of Benghazi after at least 30 people were killed in overnight fighting.
Intense fighting in Benghazi, Libya's second city, and battles between rival militias in the capital Tripoli have pushed Libya deeper into chaos after two weeks of the fiercest violence since the 2011 civil war ousted Muammar Gaddafi.
Foreign states followed the United States and the United Nations in pulling diplomats out of the North African oil-producing state after clashes between two rival brigades of former anti-Gaddafi fighters closed Tripoli's international airport.
A rocket hit a fuel depot near Tripoli airport two days ago, igniting a huge blaze that Libyan fire-fighters on Tuesday were fighting to put out. Italy's government and Italian oil group ENI had agreed to help them, the government said.
Three years after Gaddafi's fall, the OPEC nation has failed to control ex-rebel militias who refuse to disband and who are threatening the unity of the country. The extent of recent hostilities has increased Western worries that Libya is sliding towards becoming a failed state and may once again go to war.
In Benghazi, battles have intensified since special forces and regular air force units joined ranks with a renegade army general, Khalifa Haftar, who launched a campaign against Islamist militants entrenched in the city, the home of the revolution against Gaddafi's more than 40-year rule.
"Groups of terrorists calling themselves al-Shoura Council Forces are attacking the government's main military base," Colonel Wanis Bukhamada, a special forces spokesman in Benghazi, told Reuters. "We have received 30 corpses so far," a medical source told Reuters at Benghazi's main hospital.
Islamist fighters from one of those groups, Ansar al Sharia, classified as a foreign terrorist organisation by Washington, have been blamed by authorities for carrying out the attack on the U.S. Benghazi consulate in 2012 in which the U.S. ambassador was killed.
MILITIAS FIGHT FOR UPPER HAND
A government MiG warplane crashed during Tuesday's fighting in Benghazi. A Reuters reporter saw the pilot parachuting to ground after hearing an explosion. A spokesman for Haftar's forces said it was due to a technical problem.
Eastern Libya, where some of the country's major oil ports are concentrated, was where opposition to Gaddafi was strongest.
While tribal lifestyles declined in Libya as the country's growing oil wealth meant people moved into towns, traditional power structures within this nation of about six million people remained strong beneath the surface.
Gaddafi's strategy effectively amounted to a system of divide and rule, buying off established tribal leaders.
In Egypt, the army proved to be the supreme political force but in the post-Gaddafi era powerful militias have taken over fighting for power, influence and oil wealth.
Tripoli was quieter on Tuesday than over the last fortnight during which the two brigades of former rebels, mainly from the towns of Zintan and Misrata, have pounded each other's positions with Grad rockets, artillery fire and cannons, turning the south of the capital into a battlefield.
At least 160 people have died in Tripoli and Benghazi during the clashes in the two cities, according to the health ministry.
FUEL TANKS ABLAZE
A spokesman for the National Oil Corporation said on Tuesday the armed factions in Tripoli had agreed to a brief cease-fire to allow emergency services to fight the blazing fuel storage tanks containing millions of litres of fuel.
The tanks are operated by Brega oil company, which is owned by NOC, and store oil for local consumption in Libya.
Black smoke was billowing from one of the tanks hit by a rocket on Sunday near the airport road. The highway and surrounding areas were empty after homes in the area were evacuated, except for occasional militia roadblocks.
Fire-fighters were spraying the area with water to cool down storage depots near the fuel tank that was set ablaze to try to extinguish the inferno.
Italy, the former colonial power, and Italy's Eni have agreed to help Libya to counter the blaze, Libya's government said in a statement without giving further details.
Libya formally requested aid from France to fight the blaze, the French foreign ministry said. France, which has told its citizens to leave the country, has yet to ask its embassy staff to leave.
The United States, whose embassy is near to the contested airport, evacuated its embassy staff in Tripoli on Saturday, driving diplomats across the border into Tunisia under heavy military guard including air support from warplanes.
Britain, other European governments, Turkey and the Philippines have also pulled out diplomatic staff or left just a few representatives behind in Tripoli, where the violence is also causing fuel and power shortages.
France and Spain on Tuesday were evacuating more nationals and some diplomats from Tripoli, according to LANA state news agency. Canada is temporarily pulling its diplomats due to fears about their safety, Foreign Minister John Baird said on Tuesday.
Despite the chaos, Libya's oil production last week was around 500,000 barrels per day. That was up from earlier this year when unrest pushed output down to as low as around 200,000 bpd, but still below the usual 1.4 million bpd.