At least seven workers were killed and another 35 wounded in an airstrike that hit a biscuit factory on Monday in a southern suburb of the Libyan capital, Tripoli, emergency services said.
Those killed in the district of Wadi Rabea, about 21 km (13 miles) from the city centre, included two Libyans and five foreigners from Bangladesh and sub-Saharan African countries, said Usama Ali, a spokesman for the ambulance and emergency authority in Tripoli.
Pictures posted by the authority showed several wounded people in bloodstained civilian clothes lying on beds in ambulances or medical facilities.
Tripoli has been under attack since early April from forces loyal to east Libya-based commander Khalifa Haftar. The offensive by his Libyan National Army (LNA) quickly stalled, and both sides, drawing on foreign support, have used drones and fighter jets to carry out airstrikes amid sporadic fighting.
LNA airstrikes have repeatedly hit civilian areas in Tripoli. Officials in eastern Libya contacted by Reuters on Monday said they had no information about an airstrike by their forces.
Since 2014, Libya has been split between rival political and military groupings based in Tripoli and the east.
Haftar has received backing from the United Arab Emirates, Egypt, and Russia, as well as fluctuating support from some Western powers.
Last week the United States called on the LNA to halt its offensive on Tripoli, warning against Russian interference.
The conflict in and around Tripoli has killed and wounded hundreds of civilians and displaced more than 120,000.