Venezuelan President Hugo Chavez has said the "happy" end to the regional crisis with Colombia should boost unity in Latin America.
The handshakes were broadcast live by regional TV channels
"This summit was a gift from God," he was quoted by Reuters as saying after shaking hands with his Colombian and Ecuadorean counterparts at a summit.
The crisis began after Colombian troops killed Raul Reyes - the Farc rebels' second most important man - in Ecuador.
It has now emerged that four Mexicans may have been killed in the raid.
Mexico has ordered an investigation, and Ecuador has yet to confirm the identity of those killed last Saturday.
A fifth member of the Mexican group - who were all students - is recovering in a hospital in Ecuador's capital, Quito.
Colombia's government has also announced that another commander of the Farc left-wing rebels has been killed.
Ivan Rios - the youngest in the seven-member Farc secretariat - was killed by his own men in the province of Caldas, said Defence Minister Juan Manuel Santos. It was not clear why he was killed.
There were heated exchanges at the Rio Group summit of Latin American leaders in Dominican Republic that had originally been planned to discuss energy and other issues.
But the crisis became the worst political spat in the region for years.
Venezuela and Ecuador cut diplomatic ties with Bogota and sent troops to their borders after the Colombian operation which left 20 Farc rebels dead.
Nicaragua's President Daniel Ortega, who had also broken off diplomatic ties with Colombia, said they would be re-established after the presidents shook hands.
The handshakes were broadcast live on television across Latin America in response to a special request from the summit's host, Dominican Republic President Leonel Fernandez.
"We are all happy," Mr Chavez said afterwards.
"Peace! We must unite and integrate."
Ecuadorean President Rafael Correa and his Colombian counterpart Alvaro Uribe had clashed at the opening of the summit.
Mr Correa condemned Colombia's "aggression", while Mr Uribe accused his opposite number of having links with the Farc rebels.
The Colombian president said he had not warned Ecuador before the raid because Mr Correa had not co-operated in the fight against terrorism.
He also claimed material seized in the operation proved links between Mr Correa's government and the rebels.
Mr Correa rejected the claims, saying his hands were not "stained with blood".
He admitted there had been communications with Farc, but only because his government was trying to secure the release of hostages held by the rebels, including former Colombian presidential candidate Ingrid Betancourt.
But before shaking hands, to applause from the summit delegates, Mr Correa said: "With the commitment of never attacking a brother country again and by asking forgiveness, we can consider this very serious incident resolved."
The BBC's Jeremy McDermott says President Uribe's huge gamble in ordering the air strike that killed Reyes appears to have paid off.
He said Mr Uribe knew it would lead to a diplomatic incident with Ecuador, but perhaps did not realise that Venezuela and Nicaragua would also break off diplomatic relations.