An armed man from the Central Asian republic of Kyrgyzstan took another man hostage for four hours at the Russian embassy in Costa Rica on Friday in a dispute over money.
Roman Bogdanyants, 21, forced the other man, who is either from Russia or a former Soviet state, into the embassy at gunpoint following an argument on the street over money, police said.
No embassy personnel were taken hostage, they said.
Police declined to give more details about the nature of the dispute but identified the victim as Andrey Yurenkov.
"It all ended without violence, without loss of life. All the embassy staff are just fine," said Valery Nikolayenko, the Russian ambassador, who stayed in a separate floor of the building talking to police and the media as police cordoned off the embassy.
Police detained both Bogdanyants and Yurenkov.
Immigration authorities and the Costa Rican president's office said Bogdanyants was from Kyrgyzstan, a mountainous ex-Soviet republic.
Earlier reports had said he was from Uzbekistan or Kazakhstan.
The hostage-taker's mother was in the three-floor building throughout the incident trying to persuade him to give up.
Police led at least three people out of an embassy back door toward another building shortly after the stand-off began.
"At no time was any embassy official in danger," said Jorge Rojas, head of the Costa Rican judicial investigative police.
Nikolayenko said he was considering increasing security at the embassy.
Costa Rica has long been considered the most stable country in Central America and is a popular tourist destination.
But during a hostage crisis in July 2004, a Costa Rican policeman shot and killed three people inside the Chilean embassy and then turned the gun on himself after learning he was to lose his job protecting the embassy.
Seven other hostages escaped death by locking themselves in a room.