TRIPOLI - Two British journalists detained by a Libyan militia a month ago and accused of spying left Tripoli for the United Kingdom on Monday after being cleared of all charges.

Nicholas Davies-Jones and Gareth Montgomery-Johnson, who were working for Iran's English-language Press TV, were detained on February 22 by the Swehli brigade, one of dozens of militias which last year helped force out Libyan leader Muammar Gaddafi.

Earlier this month, the Swehli militia said the Britons, initially detained for entering Libya illegally, were suspected of spying. Both men were transferred to government custody last week and were released on Sunday after charges were dropped.

Arriving at Tripoli airport for their flight home, the two men looked healthy if tired. Asked if they had been well treated, Montgomery-Johnson nodded his head.

"I'm just glad to be going home and to see my family again," he said, before being whisked through to board the flight.

International rights campaigners including Amnesty International and Reporters Without Borders have said the two Britons were detained illegally and had called on the militia to either release them immediately or transfer them to the custody of the official Libyan authorities.

The fact that they were initially held by a militia has underlined the central government's struggle to extend its control across Libya since last year's rebellion.