Four gunmen who held up a Venezuelan bank and took more than 30 people hostage before escaping in an ambulance have been captured by police.
Hostages held up SOS messages from inside the bank
The gang surrendered and five captives they took with them were freed, Guarico state Governor Eduardo Manuitt said.
Police agreed to the gang's escape plan to help end a two-day standoff in the town of Altagracia de Orituco, south-east of the capital, Caracas.
The authorities had promised the gang they would not follow the ambulance.
Governor Manuitt said the "nightmare" was over.
"The important part of this was saving the lives of the hostages," he said.
"They threatened to start killing the hostages in 20 minutes, and for that reason they were allowed to leave for an unknown location to the west."
He added that the five captives had volunteered to go with the gunmen, who had promised to leave them along the way.
Justice Minister Ramon Rodriguez Chacin said the gunmen were in their early 20s and had been taking drugs, which made the situation particularly volatile.
But freed hostage Juan Carlos Gil said apart from threats to kill a security guard, their treatment was "excellent".
"After five or six hours, they began to let down their guard saying, 'You aren't going to die'," said the 19-year-old.
"They were nervous, but it was all an atmosphere as if they were everyone's friends."
It is still unclear how many hostages were left behind. The gunmen had released several hostages during the siege, while two managed to escape.
Bank executive Leon Enrique Cottin claimed there were 33 hostages, but Governor Manuitt said 50 were being released, including several children and a pregnant woman.
Hundreds of relatives had gathered outside the Banco Provincial and some of those freed were led to waiting ambulances, but there no reports of injuries.
The standoff in the quiet farming town began on Monday morning following a botched robbery.
It is understood the gunmen, armed with pistols and a hand grenade, were surprised by a uniformed police officer who pulled up to use the cash machine.
During the night, the gunmen had accepted a package with nappies and a bottle for a two-week-old baby.
On Tuesday, hostages held up handwritten help signs at the bank's windows, and used mobile phones to call and send text messages to their families.
One of the hostages said to have gone with the robbers is 25-year-old bank teller Vanessa Saavedra.
Speaking outside the bank, her distraught mother Jasmin Gonzalez told the AP news agency: "She's very brave. I know she's going to come out of this fine."
Before the gunmen escaped, Ms Saavedra spoke to Colombia's Caracol Radio.
She said: "We don't want them to shoot... We don't want them to open fire."
Security cameras captured images of the gunmen until they were cut-off and the footage has been handed to the authorities.