Two British journalists arrested last month by Libyan militias on charges of spying are coming home, the Foreign Office has confirmed.

Gareth Montgomery-Johnson, 36, and Nicholas Davies-Jones, 37, who work for Iran's state-owned Press TV, were arrested on 22 February by the Misrata militia based in Tripoli.

They were passed from the militia to the Libyan government, which released them to the British consulate.

A Foreign Office spokeswoman said: "We welcome the release of the two British journalists who have recently been detained in Libya.

"Foreign Office officials are providing them with consular assistance which we have done throughout.

"The men are in the care of consular staff, they are well and look forward to being reunited with their families soon."

In an interview with BBC's 5Live, Montgomery-Johnson's sister, Melanie Gribble, said she had expected him to return home by Wednesday.

"It is quite clichéd but it really has been ups and downs all the way. One day you would get a bit of positive news and then (there were) two or three days where you just thought 'this is not going anywhere at all'. It's been a trial," she said.

Montgomery-Johnson and Davies-Jones were taken into detention by the Misrata Swehli brigade.

A militia spokesman told Human Rights Watch that the men were detained because they were seen driving late at night and taking photographs, arousing suspicions.

The Libyan interior ministry's Abed al-Menemayad confirmed the charges had been dropped.

"They have been released and will leave the country," he said.

In a video clip recorded by the militia last week, the journalists confirmed they were in a good condition and apologised for entering the country illegally.

Montgomery-Johnson said in the video: "We are sorry for causing any inconvenience. We love Libya and we came here to film its struggle for freedom and report the news."