Witnesses said clashes had raged since Wednesday in the city, which is controlled by the internationally recognised government based in the east of the country.
Red Crescent official Mansour Ati told AFP yesterday that civilians, including children, were among the dead, whose bodies had been taken to the city's hospital.
It was not possible to say how many of the jihadists may have been killed, as Ansar al-Sharia does not take its casualties to the hospital.
Ajdabiya, 162 kilometres south of Benghazi, is located in a major oil-producing area. Since November, government personnel there have been targeted by a campaign of assassinations.
Also Read
The Islamic State jihadist group, which controls late dictator Moamer Kadhafi's hometown of Sirte, 360 kilometres to the west, have been trying to extend their influence to Ajdabiya.
UN envoy Martin Kobler issued a statement yesterday in which he said attacks targeting civilians could be considered war crimes.
The North African country has been riven by chaos and warfare since Kadhafi's fall in a 2011 NATO-backed revolt.
Libya has had rival administrations since August 2014, when the Islamist-backed Fajr Libya militia alliance overran Tripoli.