Caracas: Police say 17 hostages, including a judge, have been freed unhurt after being held for more than four hours by a man attempting to free two suspected thieves.

Police commissioner Pablo Heredia says the hostages were held in a courthouse in the coastal village of Carupano, some 400 kilometres east of Caracas.

Authorities confiscated two firearms and a grenade from the kidnapper, identified as Manuel Guarayote, after he turned himself in. Three other participants were also captured on Friday.

Guarayote had been charged with robbing a computer equipment business in September, along with the two men he was attempting to liberate: Oscar Daniel Ramirez and Kaime Jose Soledad.