The Costa Rican embassy's trade attache, Guillermo Cholele, was abducted in his diplomatic car from outside his home on Sunday night.
Details of his release are not known but a ransom was reportedly demanded.
He was the latest diplomat to be kidnapped in recent months in Venezuela, which suffers from high levels of violent crime.
Venezuelan Interior Minister Tarek El Aissami said via Twitter that Mr Cholele was in good shape and being taken by police to be reunited with his family.
His release had been secured due to investigative work and police pressure, Mr El Aissami wrote.
He said that more details on the diplomat's release would be issued later.
The Costa Rican authorities had earlier said that a ransom had been demanded.
It called the abduction "extremely serious" and said Mr Cholele needed medication for a heart condition and high blood pressure.
"For me, this kidnapping is organised crime and unfortunately Caracas is one of the most dangerous cities in the world and this is not an isolated case," Costa Rica's Deputy Foreign Minister Carlos Roverrsi said.
In January Mexican ambassador Carlos Pujalte and his wife were briefly kidnapped in Caracas before being released.
Last November the Chilean consul in Caracas was abducted, beaten and shot in the leg before being released.
In December, a diplomat from Belarus was also briefly kidnapped.
And just last month Karen Berendique - the teenage daughter of a Chilean diplomat - was shot dead by police.
Officers said she had failed to stop at a roadblock.
Venezuela has some of the highest rates of murder and kidnap in Latin America, with Caracas particularly affected.
The opposition coalition have made crime and insecurity a key issue in their campaign for October's presidential election.
Venezuelan officials say a Costa Rican diplomat who was kidnapped in the capital, Caracas, has been freed.