Libya has freed four foreign journalists detained since early April.
A Libyan official said the journalists were released to a hotel on Wednesday after they appeared this week before a judge and completed a hearing in an administrative court on charges they had "entered the country illegally."
Three of the journalists were identified as GlobalPost's James Foley, freelance journalist Claire Morgana Gillis, and Spanish journalist Manu Brabo. The fourth journalist was not identified.
Photojournalist Anton Hammerl, who has South African and Austrian citizenships, went missing in Libya around the time Libya detained the other three.
A Libyan government spokesman told the Reuters news agency that the journalists were free to remain in Tripoli and keep reporting if they wanted.
Many journalists covering the conflict in Libya have entered the country without visas.
Some information for this report was provided by AP, AFP and Reuters.