Several baboons have escaped the zoo in Libya’s Benghazi and are roaming around the eastern port city, amid fierce fighting between the army and anti-government militias that has left more than 300 people dead in the past three weeks.

Photos circulated on Twitter over the weekend showed baboons sitting on rooftops around the city.

Baboons can weigh up to 100 pounds and are powerful animals. While they are not inclined to attack humans randomly, according to travel guides, they can become aggressive if frightened or threatened – and in Benghazi there has been widespread fighting that has likely riled the escaped primates.

On 3 November, the army asked residents near the seaport in Benghazi to evacuate ahead of a planned military assault on militias in the city. Since then, battles have raged on the seafront, with army warplanes and tanks laying siege fighters from militias including US-designated terror group Ansar al-Sharia.

The fighting has left hundreds dead and caused widespread devastation in the city, leading one Libyan activist to describe the fighting as “urban warfare where [the] civilian population pays the price".

The latest fighting in Benghazi began after forces loyal to the former army general Khalifa Haftar launched an offensive in October to rid the city of what they describe as “terrorists”. Opponents of Haftar have accused the rogue military leader of seeking power and acting as an opponent of the 2011 revolution that saw long-time leader Muammar Gaddafi ousted and later killed.