The five ships which sailed from Leith in the summer of 1698 carried the hopes of a nation. Success in Darien, a central American wilderness chosen as Scotland's gateway to the new world, would bring riches and power and guarantee independence.

Instead it brought disaster. In folklore, the Scots tried to colonise a region plagued by malarial swamp, the pioneers fell sick with fever, they starved and soon abandoned the isthmus.

The financial and psychological blow led to Scotland surrendering sovereignty in the 1707 Act of Union with England.

Three hundred years later there is fresh news from Darien and for Scottish nationalists it is bittersweet: the colony was not such a daft idea after all.

Mark Horton, an archaeologist and leading authority on the subject, has visited the remote rainforest and concluded that the site was actually well chosen and that the Scots could have succeeded - had it not been for the English.

"Everybody has pooh-poohed the notion that you could create a viable colony there but in fact you could. The venture was not that stupid."

Prof Horton found that the site was ideal; rivers were navigable and would have allowed the settlers to explore the interior without having to clear swaths of jungle. The waters were also deep enough to provide natural harbours for their ships.

"And when you're there you realise the distance to the other side of the isthmus was not that great, just 50 or 60 miles. So geographically it was a good choice."

Since February's expedition Prof Horton has returned to Bristol University but he plans to return to Panama this winter to continue research on what has emerged as one of history's great what ifs.

Carlos Fitzgerald Bernal, a Panamanian archaeologist who has also visited the site, a sparsely inhabited and lawless zone near the Colombian border, agrees the Scots were not necessarily doomed.

"It could have worked for sure. The reason it probably didn't was more to do with the inner workings of the British empire."

Darien was the brainchild of William Paterson, a financial wizard who caught the Scottish public's imagination with the idea that they could catch up with English, Spanish and Portuguese conquests in the new world.

Public subscriptions funded the expedition which comprised 1,200 people, mostly discharged soldiers, doctors, lawyers, ministers and seamen. The adventure cost one fifth of Scotland's wealth, and initially things went well in what was called New Caledonia. The indigenous tribe was friendly and the settlers wrote of the abundant region as an Eden.

Months later it was a different story. The settlers did not plant crops, thinking they could trade their trinkets for food, but the natives were underwhelmed by the offerings. The Scots went hungry and fell sick.

Worse, King William forbade the English colony in Jamaica from helping the settlers since he did not want to offend the Spanish, who deemed the interlopers a threat to their own empire.

A second Scottish expedition set out but it arrived in 1700 to an abandoned settlement: the few ragged survivors of the first expedition had sailed to New England. The new arrivals quickly found themselves confronted by Spanish warships which sailed into the bay. They capitulated and fled. Virtually nothing remains of New Caledonia, an isolated backwater now known on Panamanian maps as Punta Escoces, or Scottish Point.

The publicly funded company lost more than £232,000, crippling and demoralising Scotland. English propaganda depicted the fiasco as proof that the Scots were useless and unfit for sovereignty.

"Scottish imperial dreams were seen as a disaster but Scots subsequently played a major role in the British empire as soldiers and businessmen," said Prof Horton. "The irony is that they turned out to be great empire builders after all."

Success in Darien could have changed history, with Scotland challenging English and Spanish might with the nucleus of an empire which straddled the Atlantic and the Pacific.

The English colony in Jamestown, Virginia, almost failed in 1607 after encountering similar hardships, noted Prof Horton, but it squeaked into viability. "Who would have thought Jamestown would have led to the USA?"

The conclusion that Darien might have transformed central America's most strategic point resonates all the more because this year is the anniversary of the Act of the Union as well as the founding of Jamestown, he said.

Jim Malcolm, a Scot and former British ambassador to Panama, struck a rueful note in the foreword to a 2005 booklet on his ancestors' venture. "And think. If the Scots had been successful the canal might have been constructed in Darien, by Panamanians speaking English in a lowland Scots dialect!"