Ricardo Martinelli defeated the ruling party candidate
A conservative supermarket tycoon has won Panama's presidential election, reversing a recent trend of left-wing victories in Latin America.
Ricardo Martinelli had 61%, while the ruling party's Balbina Herrera was on 37%, with most of the votes counted.
Correspondents say voters seemed to warm to Mr Martinelli's message that he was the right man to steer Panama through the global economic crisis.
He will also oversee a $5bn (£3.3bn) expansion of the Panama Canal.
"The tribunal considers you the undisputed winner of this presidential contest," the head of the electoral tribunal told Mr Martinelli in a telephone call broadcast live on television and radio.
Mr Martinelli, the candidate of a right-wing alliance led by his Democratic Change (CD) party, said he would work for a national unity government because that was what the country was calling for.
Born 11 March 1952
Business degree from University of Arkansas
Owns Super 99 - Panama's biggest supermarket chain
Other businesses include: banking, agricultural, media
1994 - 1996: Head of Social Security
1999 - 2003: Chairman of Panama Canal Authority board, Minister for Canal Affairs
"Tomorrow we will all be Panamanians and we will change this country so that it has a good health system, good education, good transportation and good security," he said in his victory speech.
"We can't continue to have a country where 40% of Panamanians are poor."
Panama has enjoyed buoyant economic growth in recent years, averaging some 8.5%, but this is forecast to slow considerably this year as the global downturn affects the crucial trade link of the Panama Canal.
Panama receives a little under one-third of its tax revenues from the canal, but through traffic has been declining significantly.
Mr Martinelli, who is set to take office on 1 July, will also oversee the expansion of the canal approved and set in motion by the current President Martin Torrijos.
The expansion programme, scheduled to be competed in 2014, aims to increase the canal's capacity, making it big enough for supertankers and the largest container ships.
Five years ago when Mr Martinelli stood for president he only gained around 5% of the vote.
But the BBC's Will Grant, reporting from the region, says this time around he appeared more in touch with the concerns of poor Panamanians by promising to clamp down on political corruption and get tough on violent crime.
Voters were clearly impressed by the conservative candidate's business acumen and his bitter criticism of the current government, our correspondent adds, but amid the difficult economic situation, Mr Martinelli may be granted a very short honeymoon period in office.
Presidents in Panama are elected for a single, five-year term.