Libya's military spokesman says eight soldiers have been killed during an attack by Islamic militants southwest of the city of Benghazi.

Speaking Tuesday, Col. Ahmed al-Mesmari said one soldier is missing and 10 were wounded in the attack early Monday.

Al-Mesmari says soldiers fighting for Libya's internationally recognized government chased the attackers, capturing many of their weapons and causing casualties. The spokesman says the soldiers "initially repelled the attack" and chased them into a neighborhood known to be a stronghold of Ansar al-Shariah and Islamic State loyalists.

Libya has slid into chaos since the 2011 overthrow and killing of longtime dictator Moammar Gadhafi.

An Islamic State affiliate has exploited the chaos, consolidating their hold last month over Sirte, Gadhafi's hometown, after putting down a local rebellion.