At least 70 people were killed Thursday when a truck bomb exploded at a police camp in Libya's north-western coastal city of Zliten, a local hospital reported.
Dozens were also injured in the suicide bombing that occurred when a crowd of policemen were gathering at the camp in the morning, witnesses said.
The truck, packed with explosives, crashed into the gate of the camp, which is used to train coastgaurds, according to the witnesses.
Most of the casualties are believed to be policemen.
Hospitals in Zliten, located around 160 kilometres east of the capital Tripoli, have appealed to local residents to donate blood for the injured victims of the attack, Libya's official news agency LANA reported.
UN envoy on Libya Martin Kobler denounced the attack.
"I condemn in the strongest terms today's deadly suicide attack in Zliten, call on all Libyans to urgently unite in fight against terrorism," the German diplomat said in a tweet.
No one has claimed responsibility for the attack, but the bombing is suspected to have been carried out by loyalists of the Islamic State terrorist militia.
"We have information that a boat carrying strangers arrived in the town two days ago," Siarj al-Rashdi, an official at the Zliten security directorate, told dpa.
"Yesterday we mounted a campaign to collect all strangers staying in the town illegally. But unfortunately, this did not stop the disaster."
Zliten, a commercial town not known for sheltering militants, is regarded as a centre for illegal migrants seeking to reach Europe.
Libya has been gripped by fighting between rival militias since the 2011 uprising that toppled longtime dictator Moamer Gaddafi.
The oil-rich country is also split between two competing parliaments, each backed by different militias. Islamic State has taken advantage of the anarchy to establish a foothold in Libya.
Earlier this week, the al-Qaeda splinter group launched an attack on al-Sidra and Ras Lanouf, Libya's major oil terminals.
Clashes between guards at the terminals and the jihadists set seven storage tanks on fire late Wednesday, an official said.
"The security situation at al-Sidra and Ras Lanouf does not allow firefighting teams to move to extinguish blazes there," said the spokesman for the state-run National Oil Corporation, Mohammed al-Harari, according to LANA.
Islamic State, which is based mainly in Syria and Iraq, controls an area of Libya's Mediterranean coast centred around the towns of Sirte and al-Nofaliyeh, west of al-Sidra.
Last month, Libyan politicians signed a UN-brokered agreement to set up a national unity government, but influential figures in the quarrelling parliaments are holding out against the deal.