Panama's vice president has won a surprise victory in the presidential election.
Juan Carlos Varela, who had distanced himself politically from President Ricardo Martinelli, has been declared the winner of Sunday's vote.
Election day began with opinion polls pointing to a tight race among the top three candidates. None had the 50-year-old Varela, the scion of one of Panama's richest families, with a lead.
Most polls gave a thin edge to Housing Minister Jose Domingo Arias, the president's choice for his replacement. Arias' running mate was President Martinelli's wife, Marta Linares.
The other top candidate was former Panama City mayor Juan Carlos Navarro.
Panama is a banking and trading hub that is best known for the Panama Canal that links the Atlantic and Pacific Oceans. The new president inherits oversight of a major expansion of the canal.
Martinelli, a supermarket tycoon, recently inaugurated the first metro in Central America in Panama City.