A general view of people walking along the Royal Mile in Edinburgh, Scotland. The British national government has opened formal negotiations with the Scots to set a date for an independence referendum that could tear modern Britain. (Jeff J Mitchell/Getty Images)

After centuries of war with England, politicians in this stately city signed away Scotland’s sovereignty in the early 1700s for the promise of riches and the glory of empire. Three hundred years later, resurgent nationalists here are plotting a new rebellion to win it back.

Appealing to the force of tartan pride, the Scottish National Party won surprise control of the regional Parliament last year, which thrust the separatist fantasy of hearing “Scots Wha Hae” on the bagpipes as the national anthem into the realm of distinct possibility. The British government, boxed into a precarious corner, has opened formal negotiations with the Scots to set a date for an independence referendum.

Scotland’s independence crusade is emerging as the greatest threat to the cohesion of the United Kingdom since Ireland achieved independence — a ­three-decade process that culminated in 1949, when Ireland left the Commonwealth.

Scotland won the right to a “devolved” Parliament in the late 1990s and has sweeping powers over, for example, its judicial system and government spending. But full independence would give the SNP the authority to fulfill a wide array of pledges, including expelling the British nuclear fleet from Scottish waters, withdrawing from NATO and unwinding Scottish regiments from Britain’s military forces overseas. It would also give politicians in Edinburgh the freedom to vote separately from — and perhaps counter to — Britain in world bodies such as the United Nations and the International Monetary Fund.

As in any divorce, a break with Britain could also set up an economic scuffle — particularly over the lucrative rights to North Sea oil, seen as key to the prosperity of the Scots on their own.

The push here is being watched with nervous eyes across Europe, particularly in countries that have long struggled with powerful separatist movements, such as Spain and Belgium. At the same time, the prospect of an independent Scotland is sending shockwaves through Westminster, the seat of the British government in London.

Fearing a diminished voice in global affairs and an irreparable split in modern Britain, Prime Minister David Cameron this month launched his own battle to win the hearts and minds of the Scots. “I believe that England, Scotland, Wales and Northern Ireland are stronger together than they would ever be apart,” Cameron declared here this month in a landmark speech for British unity. “Something very special is in danger. The danger comes from the determination of the Scottish National Party to remove Scotland from our shared home.”

His fiercest foe: Alex Salmond, Scotland’s deft political Braveheart and chief of the SNP. The party’s impressive track record in government and its efforts to protect the Gaelic language and teach the battles of Scottish history in schools have touched a nerve in a voting base physically distant and culturally apart from London, the British capital that sits geographically closer to Amsterdam and Brussels than Edinburgh.

In a move that could maximize the emotional appeal of independence, the SNP is pushing for a vote in 2014 — the 700th anniversary of the legendary Battle of Bannockburn that saw the English Army famously routed in the First War of Scottish Independence. London, meanwhile, is pressing for a ballot as early as next year to settle the issue once and for all.

“For the Scots, this is going to be decided 80 percent from the heart and 20 percent from the mind,” said Alistair Hunter, a 54-year-old nationalist working for the city of Edinburgh. “I tell ye, I’m not the kind to wear a kilt at weddings, but I am Scottish before I am British. and I know a good many of us want our rightful independence back.”

Courting celebrities

Here in Scotland, the campaign on both sides is raging from the chilly highlands to the glass offices of modern lowland cities. It is a fight being waged via bumper stickers, street graffiti and informational pamphlets, as well as in a tug of war for backing from renowned Scots, including musician Annie Lennox (a high-profile convert to the independence side) and author J.K. Rowling (publicly undecided; both camps want her under their spell).

Though polling in the past has shown core support for independence at about 30 percent, the most recent surveys indicate a race that is too close to call. Still, analysts say more Scots appear to favor remaining part of Britain — a union of England, Wales, Scotland and Northern Ireland — than favor independence. One compromise being floated by London could cede more autonomy to the Scots in areas such as taxation, though a concrete offer would be made only if a referendum on independence fails.

At the same time, the nationalists are moving to make the notion of independence more palatable, calling it a natural progression from already devolved powers that would not deeply alter Scotland’s fabric of life. Like Canada and Australia, an independent Scotland would, for instance, keep Queen Elizabeth II as its constitutional monarch. Nationalists say they would maintain the British pound — a currency already printed with Scottish images such as Brig o’ Doon and Edinburgh Castle for distribution in Scotland.

The undecideds include 30-year-old Laura Martin, who bantered with an SNP campaigner on her doorstep on a recent afternoon. “Look, I do think it’s a nice idea, I am proud of Scotland,” said the homemaker, as her two young children peered curiously from behind her skirt. “But aren’t we just too wee to survive alone?”

No, insist the nationalists, who argue that an independent Scotland would be the world’s sixth-richest nation as measured by income per person. With an economy larger than Denmark’s and a population of 5 million, they maintain, an independent Scotland would be a tartan utopia always able to afford the kinds of progressive perks already enjoyed by the Scots but not the English — including free university education, prescription drugs and home health care for the elderly.

That dream, however, is based on one big calculation: North Sea oil. Most agree that a majority of energy reserves in Scottish waters would need to be ceded by the British to make independence viable. But with analysts predicting the North Sea could be depleted by the 2030s, even a predominant share of that revenue might buy the Scots only a few decades to come up with an economically sustainable plan.

A bit surreal

Still, there is no questioning the movement’s progress. As recently as the 1960s, Scottish independence was a relatively fringe cause. But resentment of London grew during the conservative Thatcher era of the 1980s and intensified during the Iraq war. With the Conservatives’ Cameron in charge in London, for many largely liberal Scots, even the “devolution” vote in 1997 that gave them autonomy on many issues is no longer enough.

“I’ve had colleagues even from universities in northern England come up and say, ‘You Scots aren’t going to go and leave us with that lot in London, are ye?’ ” said Tom Devine, a University of Edinburgh scholar considered one of the world’s leading Scottish historians. “I’m not saying yet that independence is probable, but what is surprising so many of us now is that independence is actually a possibility.”

In staging a referendum, the British and the SNP remain at loggerheads over a few key points, including the exact wording and number of ballot questions and whether 16- and 17-year-olds — who are seen as more likely to support independence than older Scots — will be allowed to vote.

But what scares unionists most is that the three traditional British parties — Labor, Conservative and the Liberal Democrats — have lost credibility in Scotland in recent years, with no definitive Scottish voice emerging to champion the cause to stay within Britain. That has left Cameron, largely unpopular with the Scots, to lead the charge.

For the English living in Scotland, all the talk of independence still seems a bit surreal. On a visit to the site of the historic Battle of Bannockburn, depicted in the film “Braveheart,” Peter Whitham, 48, the English husband of a Scottish wife, frowned as he heard his son chasing his sister with a play sword, yelling “I’ll get ye, ye English coward!”

“The point is that we shouldn’t be Scottish or English before we are British,” Whitham said. “Come on. We’re living in 2012.”