In his latest book, David Torrance offers an insider's account of the fight for Scottish independence. With access to the strategists and opinion-makers on both sides of the political divide, The Battle for Britain goes straight to the heart of the great debate, providing an incisive, authoritative and occasionally trenchant guide to the most dramatic constitutional question of our times. Below is an excerpt from the first chapter of the book, which is available from Biteback Publishing.

It was almost as if Scotland had already become an independent country.

Sitting at an unremarkable table in Alex Salmond's equally unremarkable office at St Andrew's House in Edinburgh, David Cameron glanced at his Scottish counterpart before handing over his copy of what became known as the 'Edinburgh Agreement'. The first minister of Scotland beamed as he added his signature to the document; the prime minister of the United Kingdom was more controlled, appearing businesslike rather than pleased. Salmond looked up for the benefit of photographers, Cameron did not. "Right," said the latter as both men got to their feet. "The switch," he added, almost as if talking himself through the agreed sequence of events. The two men then exchanged their copies – printed on neutral beige paper – of the agreement. Finally, they shook hands as the prime minister murmured "there we are", and photographers snapped away.

After more than a year of political shadow boxing they had agreed that Scots would vote on independence in a referendum to be held by the end of 2014. But the symbolism was obvious. "Scotland is already looking and feeling like an independent nation," noted one of Salmond's advisers. "[This] sets a template for the relationship that would exist after independence." Constitutionally the more senior of the two, Cameron had travelled to Edinburgh rather than summon Salmond to London, while the exchange of signatures took place in front of a predominantly yellow map of Scotland. The yellow, although it was not immediately obvious, denoted constituencies won by the Scottish National Party in the Scottish parliament elections of May 2011.

It was that triumph, that overall SNP majority in a parliament designed to prevent one party dominating, which had brought the two politicians together on 15 October 2012, a crisp, clear autumn's day. It had begun with the first minister at a school in Edinburgh (reading from the children’s book, We're Going on a Bear Hunt) and the prime minister visiting the Rosyth Dockyard with the none-too-subtle backdrop of a half-constructed aircraft carrier "This is a success story that the whole of the United Kingdom can take great pride in"). Later they met, as two leaders within one kingdom, at the entrance to St Andrew's House, an imposing 1930s building which used to house the old Scottish Office. Aptly, one of the allegorical figures above its large brass doors was called 'State Craft', depicting a male figure holding open a scroll with both hands.

But the day did not feel statesmanlike, or particularly historic. As the prime and first ministers shook hands for the assembled media there were no demonstrations or banners, just barriers and police officers, while a lone voice yelled, slightly incoherently, "vote yes for independence Mr Cameron". Some of those present in Alex Salmond's fifth-floor office remembered him being uncharacteristically 'low-key', perhaps because his advisers had told him not to look triumphalist. "We didn’t regard this as a treaty, a summit or anything else; we were simply doing a deal to transfer power," recalled a Whitehall adviser. "The prime minister's role was also businesslike, he didn't stick around."

Although Salmond was deferential to inter-governmental protocol, this courtesy did not always extend to the prime minister ("So what drove the Camerons out of Scotland?" the first minister once asked him nonchalantly, a barbed reference to Cameron's Scottish ancestry). Nevertheless there was a degree of mutual respect. Both men were smart operators, shrewd tacticians who reveled in their political status if not the philosophy and nitty-gritty of politics. They had much in common, despite being separated by age and class, an Old (but at the same time younger) Etonian pitched against a product of Linlithgow High School. One of the first things Cameron had done on becoming prime minister in 2010 had been to visit Salmond in Edinburgh as part of his so-called 'respect agenda', while inside Downing Street the first minister was generally held in high regard as a political operator.

Despite Westminster reluctance, the Scottish government had been keen to big up the significance of the event. Its website later referred to the signing as 'ratification' of the Agreement (Salmond called it an 'accord'), which imbued an essentially political agreement with a legal status it simply did not possess. It did, of course, have legal and political ramifications, not least a commitment by the UK government to promote an Order in Council under Section 30 of the Scotland Act 1998, which had established the devolved Scottish parliament. Although that parliament – housed in a controversial new building at Holyrood since 2004 – had wide-ranging powers, the ability to hold a referendum on independence was not among them.

But a Section 30 Order would temporarily grant the Scottish government that power, subject to a majority vote by members of the Scottish parliament (MSPs). Of course there were caveats: it was to be a single-question referendum, rather than the two-question ballot Salmond had often hinted at, and the question would have to be put by the end of 2014. (The UK government considered the temporary nature of these powers crucial; there existing a genuine fear Holyrood might try to hold further referendums, for example following an election victory in May 2016). Constitutional lawyers had spent years speculating over what would happen were the Scottish government to hold an ultra vires poll, but a Section 30 Order, asserted the text of the agreement, would put that 'beyond doubt'.

It thus fell to the Scottish government to place a referendum bill before the Scottish parliament, which the agreement stipulated ought to "meet the highest standards of fairness, transparency and propriety, informed by consultation and independent expert advice". In particular, the legislation would set out the date of the referendum, the franchise, the wording of the question, rules on campaign financing, and other rules for the conduct of the referendum.

This, although it was not spelled out in the short text of the agreement, meant the Scottish government could set the date of the referendum (provided it took place before the end of 2014), extend the franchise to 16-and-17-year-olds (a long-standing SNP, and indeed Liberal Democrat, pledge), decide the wording of the question (subject to Electoral Commission approval) and stipulate campaign financing (again, subject to EC oversight). Usefully, this allowed both governments to claim victory; in reality, it was a political draw.

Nationalists later placed great emphasis on paragraph 30 of the agreement, headed 'Co-operation', the final sentence of which read: "The two governments are committed to continue to work together constructively in the light of the outcome, whatever it is, in the best interests of the people of Scotland and of the rest of the United Kingdom." Although the UK government considered this innocuous, their Scottish counterparts imbued it with greater significance, convinced it meant Westminster could neither "scaremonger" against independence nor obstruct its progress should there be a Yes vote. Advisers at Westminster, meanwhile, dismissed this reading of paragraph 30 as "absurd".

Two other signatories to the agreement had been notable players in the political drama thus far: the secretary of state for Scotland, Liberal Democrat MP Michael Moore, and Nicola Sturgeon who, as deputy first minister of Scotland, had concluded the referendum negotiations just days before Salmond and Cameron had put pen to paper. Once that was done, the prime minister gave brief television interviews on the roof of St Andrew's House before heading back to London without even acknowledging reporters gathered outside. His aides claimed this was to avoid hogging the limelight. "The first minister wants to attract as much attention as possible," one UK government source said. "We just want to bomb him with reasonableness." Another official put it more cynically: "We had given them just enough rope to hang themselves."

Reporters from all over the world had descended on Edinburgh, no doubt intrigued by the novelty of the occasion. CNN referred to the referendum taking place 700 years after "William Wallace died for Scottish independence"; while the Washington Post said the vote "sets up the possibility that Washington's closest strategic ally could be torn asunder". Closer to home, the Herald newspaper dubbed it 'A DATE WITH DESTINY', while the Scottish Sun read simply: 'SHAKE OR BREAK TIME.'

"I want to be the prime minister that keeps the United Kingdom together," Cameron told the BBC, betraying an understandable fear of becoming a 21st century version of Lord North (who had lost America in 1776). "The people of Scotland voted for a party that wanted to have a referendum on independence. I've made sure – showing respect – that we can have that referendum in a way that is decisive, that is legal, that is fair." The prime minister even mimicked Salmond's populist rhetoric by claiming the deal had delivered "the people’s referendum".

With that, he was off, leaving Salmond and his deputy Nicola Sturgeon to face the media in the bowels of St Andrew's House, where the Scottish government had been free to indulge itself with a couple of huge Saltires. The agreement, Salmond told reporters, paved the way "for the most important decision our country of Scotland has made in several hundred years". When BBC political editor Nick Robinson asked why, after a summer in which Andy Murray and Sir Chris Hoy had wrapped themselves in the Union flag, he wanted to rip it up, Salmond replied with a smile: "I don't want to rip anything, we're not in the business of ripping things up. We're in the business of developing a new relationship between the peoples of these islands; I think a more beneficial, independent and equal relationship – that's what we're about."

Later, Salmond said the agreement marked a "significant step in Scotland's Home Rule journey", an interesting turn of phrase which summed up his gradualist approach to constitutional change. "The Scottish government has an ambitious vision for Scotland," he added, "a prosperous and successful European country, reflecting Scottish values of fairness and opportunity, promoting equality and social cohesion. A Scotland with a new place in the world – as an independent nation."

But despite the fine words, at this point – indeed at every point in the process – Salmond was acutely aware independence was not the settled will of the Scottish people, only around a third of whom consistently told pollsters they would vote Yes in the autumn of 2014. Writing in the Scotsman the following day, Stephen Noon, the Yes campaign's chief strategist, cryptically remarked that "detailed research" showed that opinion polls did "not adequately reflect" where Scottish opinion was. "For many who today say No," he said, "a more appropriate description would be not proven."

Nevertheless, the pan-Scottish jury was still out and smart political tactics required a recalibration of how independence was presented to the electorate. "My passion has never been to cross some imaginary constitutional finishing line and think the race is won," wrote Salmond, a little disingenuously, in the Guardian a few days later. "My aim now, as it always has been, is to deliver a better and fairer society for the people of Scotland. It happens that independence is the way to do this" (my italics). Key to this "better and fairer society" was what the first minister called Scotland's 'social contract', "which has delivered universal benefits such as free university education and personal care for our elderly"; a contract he claimed was "now threatened by both Labour and the Tories". Only a Yes vote, therefore, could "properly protect these gains".

So welfare, then being reformed by the coalition government and only partially resisted by the Labour party, was – in the SNP's eyes – a key battleground in the independence debate. David Cameron, on the other hand, argued that pan-UK institutions like social security bound the nations and regions of the UK closely together. "This marks the beginning of an important chapter in Scotland's story and allows the real debate to begin," he said shortly before the agreement was signed. "It paves the way so that the biggest question of all can be settled: a separate Scotland or a United Kingdom? I will be making a very positive argument for our United Kingdom."

Despite his relatively low-key presence in Edinburgh that day, the prime minister was quietly confident he had done the right thing by intervening in the Scottish debate and forcing – as the UK government saw it – Mr Salmond's hand. Until that point the SNP leader had appeared invincible. Despite the absence of any groundswell in support for independence, the first minister's sheer force of personality and his unparalleled success in winning an overall majority at the 2011 Holyrood election had created the sense that anything was possible.

Still, while Cameron had been the victor in initial skirmishes over the referendum itself, this had only been the beginning. The phoney battle for Britain was over, now, with the completion of the Edinburgh Agreement, the real fight had begun, and the stakes could not be higher. "The game’s changing in this all the time," Salmond told an interviewer that evening, "and I think the game will change in favour of the Yes campaign."

David Torrance is a writer, journalist and broadcaster specialising in Scottish and UK politics. He appears regularly on the BBC and Sky and is a regular columnist with The Herald newspaper. He has written more than ten books on politics, history and biography. He divides his time between Edinburgh and London.

Click here to buy The Battle for Britain at the special reduced price of £9.99.