The Dawn of Libya, an Islamist militia group, has said that it has secured the US embassy compound in the Libyan capital Tripoli, more than a month after US staff evacuated the building.

Although windows at the compound have been smashed, most of the equipment that had been left by the Americans remained untouched, according to an AP journalist who was invited by the militants to have a look around.

A commander of the militia group said that his forces have been in control of the former embassy since last week.

A poorly-filmed video has appeared on YouTube showing men, who may or may not be the Islamic militants, fooling around by the swimming pool, while some of them perform reckless dives from an upper balcony into the shallow pool.

Safira Deborah, the US Ambassador to Libya, said the video appeared to have been filmed in the residential annex of the embassy.

A commander of the Dawn of Libya told AP that his forces had seized control of Tripoli, the Libyan capital, and its strategic airport after weeks of fighting with a rival militia, which he said his forces took over the embassy compound from.

The Dawn of Libya is deployed around Tripoli and has asked foreign diplomats to return now the fighting has largely stopped.

The US embassy was evacuated in July, as a last-minute ceasefire between warring militias collapsed and the capital fell into complete chaos.

The US embassy is located near the airport, which marked the frontline between two rebel groups. For weeks the staff sheltered in concrete bunkers while 90 heavily armed US Marines fended off any would-be attackers. However, the embassy did not take any direct hits.

The evacuation of the embassy in Tripoli was soon followed by EU embassies and brought back memories of the death of Chris Stevens, the last US ambassador to Libya who died along with three of his staff when the US consulate in the eastern Libyan city of Benghazi was overrun by militia two years ago.

Libya has descended deep into chaos since the overthrow of Muammar Gaddafi in 2011. A student who joined the uprising against Gaddafi in 2011 told The Guardian: “This is not what I fought the revolution for. We fought for peace and instead we get this.”