Scotland voted in a referendum on Thursday to choose whether to end the 307-year-old union with England and become an independent nation or stay within the United Kingdom - a decision which could have consequences across the globe.
From remote highlands and islands to the tough city estates of Glasgow, people were almost equally divided over a vote watched closely by Britain's allies, investors and restive regions at home and abroad.
Polling booths closed at 10:00pm local time (21:00 GMT) Thursday, and the counting of ballots began with the result expected in the early hours of Friday. Officials expect a turnout as high as 80% .
Pre-voting opinion polls gave the "No" campaign - those in favour of remaining in the United Kingdom - a slight edge. But hundreds of thousands of people still making up their minds held the key as polling stations opened.
Tennis star Andy Murray sent a powerful last-minute message in support of the pro-independence "Yes" vote, tweeting "Let's do this" after months of silence on his views.
Many people see the choice as one of "hearts or heads" - whether emotional stirrings and yearnings would outweigh pragmatic concerns over the risks and uncertainty that an independent state would face.
The issue has divided families and friends but also electrified this country of 5.3 million in months of debate.
In the final hours before polling stations opened, leaders of both sides urged Scots to seize the reins of history in answering "Yes" or "No" to the question: "Should Scotland be an independent country?"
"I've waited all my life for this," said the first voter in Edinburgh's Waverley Court, a businessman who gave only his first name, Ron. "It's time to break with England. 'Yes' to independence."
As he spoke, a couple of workers hurrying by in the morning mist and drizzle shouted "Vote No!"
On Edinburgh's main Princes Street, overlooked by a foreboding castle, "Better Together" campaigners handed out leaflets saying "Vote No." "It's not worth the risk. There's no going back."
Alex Salmond, the 59-year-old nationalist leader, told hundreds of supporters in Perth at a final rally: "Scotland's future must be in Scotland's hands."
"This is our opportunity of a lifetime and we must seize it with both hands."
The independence movement says Scots should be able to choose their own leaders and make their own decisions rather than be ruled from London. Supporters of the union say Scotland is more prosperous and secure as part of the United Kingdom and the ties that bind its peoples are too tight to be undone.
Salmond has said Queen Elizabeth should stay on as Queen of Scots. She has remained above the fray, in keeping with the constitution, but said on Sunday she hoped Scots would choose "carefully".
What would be left?
The prospect of breaking up the United Kingdom, the world's sixth-largest economy and a permanent member of the United Nations Security Council, has prompted citizens and allies alike to question what would be left, while the financiers of the City of London have warned of market turmoil.
British politicians, banks and businessmen have closed ranks to warn of economic hardship, job losses and investment flight should Scots decide to go it alone. Defence would also be a big question - Britain's submarine-borne nuclear arsenal, part of NATO's defences - is based in Scotland's Firth of Clyde.
The United States has made clear it wants the United Kingdom, its main ally in Europe, to remain together.
"The UK is an extraordinary partner for America and a force for good in an unstable world. I hope it remains strong, robust and united," US President Barack Obama said.
European leaders have warned that an independent Scotland would have to get to the back of the queue to join the European Union. Spain has been especially vocal, fearing it would further inspire separatists in Catalonia and the Basque Country, many of those voting for independence felt rule from London had opened too wide a gap between rich and poor. "I want a different kind of Scotland, a socially just Scotland," said Lisa Clark, a church worker, after casting her vote for "Yes".
Five surveys showed support for independence at 48%, compared with 52% for the union, while a fifth poll showed it even closer at 49% to 51%.
Another showed unionists at 53% and separatists at 47%.
The surveys also showed as many as 600,000 voters were undecided, making the vote too close to call. Polling stations close at 2100 GMT and a result is expected early on Friday.
In Glasgow, there was a carnival-like atmosphere, with some people wearing blue-and-white face paint. A man running a financial services business and a hotel on the Isle of Skye had come down to his hometown Glasgow to cast a "No" vote.
"I think it's a great concept, but working in finance I can see the difficulties," he said, giving his name as Eddie.
Salmond has employed a mix of shrewd calculation and nationalist passion to haul the "Yes" campaign from far behind to within a whisker of winning his dream of an independent Scotland. But the momentum needs to continue if he is to win.
Facing the biggest internal threat to the United Kingdom since Ireland broke away nearly a century ago, Britain's Prime Minister David Cameron could find his job on the line if Scotland breaks away.
The 47-year-old prime minister has conceded that his privileged English background and Conservative politics mean he is not the best person to win over Scots, although in the past few weeks he has made emotional appeals for Scotland to stay in Britain's "family of nations".
That has left the leadership of the unionist case in the hands of the opposition Labour party, the only party with the local support capable of checking the secessionist Scottish National Party.
Former Labour Prime Minister Gordon Brown, a Scot who has in recent days led the battle cry for the union, on Wednesday warned Scots in Glasgow, Scotland's biggest city and a crucial battleground, that Salmond was "leading us into a trap".
"Have confidence, stand up and be counted tomorrow," Brown thundered, fists clenched, to applause and cheers from unionist supporters. "Say to your friends, for reasons of solidarity, sharing, pride in Scotland, the only answer is vote 'No'."
A united kingdom?
In the event of a vote for independence, Britain and Scotland would face 18 months of talks on how to carve up North Sea oil and what to do about EU membership.
Scotland says it will use the pound after independence, but London has ruled out a formal currency union, while Britain will have to decide what to do about the nuclear submarine base on the Clyde, which the nationalists want to evict.
Salmond has accused London of orchestrating a campaign by business leaders aimed at spooking Scots after businesses from oil giant BP BP.L to financial services group Standard Life SL.L cautioned about the risks of independence.
To blunt Salmond's argument for breaking away, Britain's rulers promised to guarantee Scotland high levels of state funding and grant Scots greater control over finances.
British leaders accept that even if Scotland votes to keep the union, the United Kingdom's structure will have to change, as granting further powers to Scotland will provoke calls for a less centralised state from voters in England, Wales and Northern Ireland.
Some currency traders in London prepared to stay up all night to buy or sell sterling GBP on the results of the vote.
US Treasury Secretary Jack Lew said there were potentially significant economic ramifications from the vote and that a strong United Kingdom was important.
Electoral officials said the result is expected by breakfast time on Friday morning, but partial results will give an indication of the trend after the count of major cities such as Glasgow are declared around 0400 GMT.
With more than 486,000 voters, Glasgow is crucial, and the way its traditional Labour supporters go could be decisive.
Edinburgh and Aberdeen, which with Glasgow make up nearly a quarter of the vote, are also expected around about that time.
Helicopters will fly from specially lit landing sites from remote islands to deliver ballot boxes to regional counting centres.
(With AFP inputs)