By Nicholas Winning, Matt Moffett and Jenny Gross 

Scotland's independence referendum has generated a political shock that will have long-term implications for how the U.K. is governed and is already reverberating across Europe and the world.

Whether it won or lost Thursday's vote to break away from the United Kingdom, the Scottish National Party's unlikely bid to push the U.K. to the brink of a breakup forced a desperate British government to promise Scotland's devolved parliament more control over its affairs than it has ever had within the fold of the U.K. A brushfire of autonomy could now spread to Wales, Northern Ireland or even other regions of England that have long been ruled primarily from London.

Scotland has also become the role model for a growing list of other separatist groups seeking independence, in Europe and elsewhere. Those groups have poured into Edinburgh this week to study what now may be seen as a template for challenging their own capitals. The independence roadshow will soon shift to Spain, where the country's Catalonia region is pushing for its own secession referendum.

In the U.K., Scotland is poised to win more power in any outcome thanks to the ability of independence campaigners to, almost overnight, erase a double-digit deficit in opinion polls and turn a potential landslide defeat into a virtual dead heat.

Suddenly faced with a much closer-run race than expected, Prime Minister David Cameron and the leaders of the two other largest U.K. parties went into scramble mode, promising to introduce legislation to grant Scotland's semiautonomous government more powers if voters reject independence. They pledged to begin that process on Friday, according to a timetable set out during the referendum campaign by former Prime Minister Gordon Brown and endorsed by party leaders.

It promises to be a messy process that will take years to untangle. Details of exactly what powers would be transferred, or how, remain unclear.

"It is inevitable that the promises that have been made are going to be incredibly difficult to deliver," said Andrew Hawkins, chairman of London-based polling company ComRes.

Scotland's referendum is likely to unleash momentum for transferring powers to other regions--a concept that creates problems for Mr. Cameron because it is unpopular with many in Mr. Cameron's Conservative Party.

"Cameron is going to be under increasing pressure from his own backbenchers over what he has promised," said Mr. Hawkins. The prime minister "risks opening all sorts of cans of worms with Northern Ireland and Wales in particular and expectations about an English parliament."

One critical hurdle is that the three political parties at Westminster don't agree on which powers to devolve to Edinburgh. On paper the differences are small--for example, whether to give Edinburgh full control over the rate of income tax in Scotland or to give it the power to vary it from the U.K. rate only a little--but they could add up to billions of pounds a year in revenue and the autonomy that represents.

Another potential hurdle is whether predominantly English lawmakers in the U.K. parliament will agree to give Scotland more power without securingsome concessions to their own voters. There is also the concern that a close result will sharpen nationalists' appetite for another vote in the not-too-distant future, raising the risk of a so-called "neverendum" which could unsettle investors and hurt Scotland's economy.

The offer of further devolution for Scotland could prompt other regions, such as Wales and Northern Ireland, in the U.K. to push for greater powers. In an effort to appease nationalist movements elsewhere, the U.K. government has committed to giving the Welsh administrative control over some taxes and introduced a bill to allow for a referendum on whether some control over income tax should be devolved as in Scotland.

A cross-party U.K. parliamentary committee has agreed to hold an inquiry to consider whether the levels of devolution that are being offered to Scotland should be offered to England, Wales, and Northern Ireland, and whether there should be a written constitution to establish that settlement.

"My own view is that if it's good enough to offer to Scotland, it's good enough for England, Wales and Northern Ireland," Graham Allen, a Labour Party politician and the chair of the Political and Constitutional Reform Committee, said in a statement when the inquiry was announced on Sept. 9.

Leanne Wood, the leader of Plaid Cymru, the Welsh nationalist party, said she hopes a similar independence debate will grow in Wales. "I want to see Wales, and I want to see people in Wales have their say in the same way as people in Scotland have had their say," she said. "We have got the right to self-determination, we're a nation, too."

As the U.K.--or what is left of it--grinds out its future, the Scotland independence drive has galvanized secession supporters from Europe to Africa and beyond. Wherever there are disputes over regional sovereignty, separatist groups are sure to cite the Scottish referendum, amicably agreed to by leaders in London and Edinburgh, as a template for conflict resolution.

Nowhere would the Scots' "yes" vote trigger more euphoria than in Catalonia, a wealthy industrial region in northern Spain that is preparing for a nonbinding referendum on independence in November. The government in Madrid vows to sue to block the referendum, which it says is unconstitutional.

"The Scots have helped inspire us in our fight, all along the way," said Rosario Borras, one of an estimated 1.8 million pro-independence Catalan demonstrators who last week poured into the streets of Barcelona to form a giant V-for vote.

A host of Catalans traveled to Scotland this week to lend moral support to the independence push, including three firemen who made the trip crammed into a tiny 45-year-old Seat sedan. And they weren't alone: Separatist movements from places as far-flung as Italy's island of Sardinia showed up to learn the Scottish formula.

In the rest of Europe, the Scottish vote could help reinvigorate once-potent independence movements that have lost momentum in places such as Spain's Basque Country, northern Italy and the Flanders region of Belgium.

But what secessionists see as a flight to freedom is just another big headache for others. If any of the separatist efforts advance, it will create a new and complicated set of problems for both national governments and other bodies, like the European Union.

The Scottish case could set a precedent for how the EU treats a new country carved out of an existing member state. "The consequence of a 'yes' vote is going to finally be the European Union expanding itself internally," said Xavier Solano, an adviser to the pro-independence Scottish National Party who was formerly the Catalonia government's permanent representative to the U.K. "It would be the first of amplification of member states from within."

While Mr. Solano thinks the EU will smoothly incorporate Scotland, that is far from clear. EU officials have said they will take their time in examining the Scottish case. And there is sure to be resistance is certain from states with homegrown separatist movements, such as Spain.

On Wednesday, "Everyone in Europe thinks these [independence] processes are enormously negative," Spanish Prime Minister Mariano Rajoy called the independence process "a torpedo in the soft spot of the EU, which has been created to integrate states not separate them." For that reason, he said, "it is going to be very difficult" for newly independent regions to be accepted in the EU.

Jason Douglas contributed to this article.