The United States and four European countries have jointly called for an end to violence in Libya.
The governments of France, Italy, Germany, Britain and the United States said in a statement that they "agree that there is no military solution to the Libyan crisis".
They also expressed dismay that calls for a ceasefire had not been respected.
Dozens of people have been killed in Benghazi in days of fighting between Islamic militant groups and pro-government forces led by former General Khalifa Haftar.
The joint statement voiced concern over Mr Haftar's offensive and said Libya's "fight against terrorist organisations can only be sustainably addressed by regular armed forces under the control of a central authority."
Libya has failed to build up state security forces and disarm former rebels who helped remove Muammar Gaddafi, who ruled the country for 42 years until his downfall in 2011.
The US and its four European allies also condemned Ansar al-Sharia and said "Libya's hard fought freedom is at risk if Libyan and international terrorist groups are allowed to use Libya as a safe haven."
The statement threatened sanctions against individuals who "threaten the peace, stability or security of Libya or obstruct or undermine the political process."
Libya also is struggling with two competing governments vying for control after armed groups from the western city of Misrata seized the capital of Tripoli in August, forcing the government of Prime Minister Abdullah al-Thinni to withdraw to the east.