Behind the locked doors of her office in Downing Street, Theresa May began writing the letters by hand after reading the notes given to her by the military and intelligence chiefs one more time.

The prime minister then shredded the notes and her earlier drafts, before opening the door and handing sealed envelopes to the officials waiting outside.

Ms May had written the “letters of last resort” – instructions about nuclear weapons to the captains of Britain’s four submarines. They were only to be opened if the country was in a war of such magnitude that launching Trident ballistic missiles, with its devastating consequences, had become an option.

Margaret Thatcher had asked for an extra-stiff whisky when her turn had come to write the letters. Tony Blair is said to have turned white when told he would have to write them. James Callaghan had spoken of agonising doubts about the decision he had made. No one apart from the prime minister is supposed to know the content but Jeremy Corbyn has already publicly announced that he would not authorise the use of nuclear missiles if he headed a government.

Gavin Williamson, who had ambitions of writing such a letter himself in the future from Downing Street, was in Clyde Naval Base at Faslane on Monday, along with a small party of journalists.

UK news in pictures Show all 50 1 /50 UK news in pictures UK news in pictures 18 September 2020 A model presents a creation during the Bora Aksu catwalk show at London Fashion Week 2020 Reuters UK news in pictures 17 September 2020 World kickboxing champion Carl Thomas during his attempt to run a marathon while pulling a plane at Elvington Airfield near York. The attempt is raising funds for Ollie's Army Battling Against Battens, an organisation campaigning to raise GBP 250,000 to fund a clinical trial aimed at saving the sight of children with CNL2 Batten Disease PA UK news in pictures 16 September 2020 Labour deputy leader Angela Rayner speaking during Prime Minister's Questions UK Parliament/AFP/Getty UK news in pictures 15 September 2020 People enjoying the autumn sunshine as they punt along the River Cam in Cambridge PA UK news in pictures 14 September 2020 Early morning light bathes the skyscrapers of the City of London, at the start of a week in which the UK is expected to bask in temperatures of more than 30 degrees PA UK news in pictures 13 September 2020 England celebrate after they dismissed Australia's Alex Carey to win the second ODI match of the series at Emirates Old Trafford, Manchester PA UK news in pictures 12 September 2020 Protesters outside BBC Broadcasting House in central London, as marches and rallies form across the country calling for a 15% pay rise for NHS workers and an increase in NHS funding PA UK news in pictures 11 September 2020 An empty migrant dinghy floats off the beach at St Margaret's Bay after the occupants landed from France in Dover Getty UK news in pictures 10 September 2020 A view of small boats thought to be used in migrant crossings across the Channel at a storage facility in Dover, Kent PA UK news in pictures 9 September 2020 EU's chief negotiator Michel Barnier, left, arriving from the Eurostar with EU Ambassador to the UK, Portuguese diplomat Joao Vale de Almeida at St Pancras International railway station, London, for the latest round of the negotiations on a free trade deal between the EU and the UK PA UK news in pictures 8 September 2020 Dawn over Coquet Island, a small island off Amble on the Northumberland coast PA UK news in pictures 7 September 2020 A hovercraft arrives to Southsea, Hampshire from the Isle of Wight PA UK news in pictures 6 September 2020 Forensics officers near the scene of multiple reported stabbings in Birmingham Reuters UK news in pictures 5 September 2020 Anti-migrant protesters demonstrate in Dover against immigration and the journeys made by refugees crossing the Channel to Kent PA UK news in pictures 4 September 2020 Activists take part in a demonstration against the HS2 hi-speed rail line outside the Department of Transport AFP via Getty UK news in pictures 3 September 2020 Peter Baker, who plays Trigger in the musical version of Only Fools and Horses, sweeps the stage of the Theatre Royal Haymarket in London, after observing a 15 minute silence to show solidarity with those in the theatre industry that have lost their jobs due to the coronavirus pandemic PA UK news in pictures 2 September 2020 Kadie Lane, right, 11, and Brooke Howourth, 11, hug on their walk to Marden Bridge Middle School in Whitley Bay, Tyne and Wear, for their first day of term, as schools in England reopen to pupils following the coronavirus lockdown PA UK news in pictures 1 September 2020 Extinction Rebellion protesters sitting outside The Houses of Parliament in Westminster, London PA UK news in pictures 31 August Surfers at Long Sands Beach, Tynemouth PA UK news in pictures 30 August Black Lives Matter protesters march through Notting Hill in London in the first Million People March EPA UK news in pictures 29 August A protester reacts as she demonstrates against the lockdown and use of face masks, amid the coronavirus disease outbreak, outside Downing Street in London Reuters UK news in pictures 28 August Caribbean soca dancers display their costumes as they promote the first ever digital Notting Hill Carnival, following the cancellation of the normal Carnival festivities due to the continued spread of the coronavirus disease, in London Reuters UK news in pictures 27 August Father and son team Chris and Sam Milford from historic building conservation specialists WallWalkers begin restoration work on the spire of Norwich Cathedral, which stands at over 312ft high. The first known spire was completed in 1297 PA UK news in pictures 26 August Giant waves at Seaham in County Durham, as the bad weather continues PA UK news in pictures 25 August An assistant at the Wallace Monument cleans the case which houses the William Wallace sword in the Hall of Arms room at the monument near Stirling as they prepare to re-open PA UK news in pictures 24 August Restored World War Two landing craft LCT 7074 is transported from from the Naval Base in Portsmouth to its final resting place at the D-Day Story at Southsea PA UK news in pictures 23 August Jenny Nguyen and Tony Cao, from Vietnam, pose for wedding photos on Tower Bridge in London, as it remains closed to vehicles after it was stuck open on Saturday due to a "mechanical fault". The landmark's Twitter account confirmed only pedestrians and cyclists could use it on Sunday morning PA UK news in pictures 22 August England's Zak Crawley hit 267, joining the exclusive Double Hundred club, on day two of the Third Test match against Pakistan at the Ageas Bowl, Southampton PA UK news in pictures 21 August Harri Teale gathers lavender during the annual harvest on the Wolds Way Lavender farm near Malton in North Yorkshire PA UK news in pictures 20 August Parents and a student react after checking GCSE results at Ark Academy in London Reuters UK news in pictures 19 August Tate Modern workers hold a strike outside the gallery in London, to protest the institution's announcement that it would cut more than 300 jobs from its commercial arm, Tate Enterprises PA UK news in pictures 18 August Two rescued brown bear cubs, Mish (left) and Lucy, cool off in a pool after arriving at their new home with the wildlife conservation charity Wildwood Trust in Herne Bay, Kent. The orphaned pair, who have been living in a temporary home in Belgium since they were found abandoned and alone in a snowdrift in the Albanian mountains, will be acclimatised to their new life in the country before moving to a permanent home PA UK news in pictures 17 August A level students celebrate outside the Department for Education in London after it was confirmed that candidates in England will be given grades estimated by their teachers, rather than by an algorithm. The government U-turn comes just days after Education Secretary Gavin Williamson vowed there would be "no U-turn, no change. PA UK news in pictures 16 August Wasp players take a knee as Northampton Saints stand prior to kick-off in their Premiership match at Franklin's Gardens PA UK news in pictures 15 August Piper Colour Sergeant Lil Bahadur Gurung attends the VJ Day National Remembrance event, held at the National Memorial Arboretum in Staffordshire, Britain Reuters UK news in pictures 14 August People including students hold placards on Whitehall outside Downing Street as they protest against the downgrading of A-level results. The government faced criticism after education officials downgraded more than a third of pupils' final grades in a system devised after the coronavirus pandemic led to cancelled exams yes AFP via Getty UK news in pictures 13 August Benita Stipp (centre) and Mimi Ferguson (left) react as students at Norwich School receive their A-Level results PA UK news in pictures 12 August 2020 A train derailment near Stonehaven has left three people dead. Driver Brett McCullough, conductor Donald Dinnie, and a passenger were killed when the 6.38am Aberdeen to Glasgow Queen Street service crashed amid heavy rain and flooding BBC UK news in pictures 11 August 2020 A woman hydrates in the sun after open water swimming at the West Reservoir Centre in north London Tolga Akmen/AFP via Getty UK news in pictures 10 August 2020 Prime Minister Boris Johnson takes part in an archery session as he visits Premier Education Summer Camp at Sacred Heart of Mary Girls' in Upminster Reuters UK news in pictures 9 August 2020 People cycle through Cambridge as the heatwave continues in Britain EPA UK news in pictures 8 August 2020 Healthcare workers take part in a protest in London over pay conditions in the NHS Getty UK news in pictures 7 August 2020 Emergency services make their way along the seafront on Bournemouth beach in Dorset on one of the hottest days of the year PA UK news in pictures 6 August 2020 Alison Murphy poses for a picture by husband Peter as she walks through a field of sunflowers in Altrincham, Cheshire PA UK news in pictures 5 August 2020 Pakistan's Abid Ali being bowled by England's Jofra Archer during day one of the First Test match at the Emirates Old Trafford, Manchester PA UK news in pictures 4 August 2020 The 'Timbuktu tumblers' from Kenya perform their balancing act on the Southsea waterfront as Zippos Circus reopens in Portsmouth Rex UK news in pictures 3 August 2020 Pelicans interact with a visitor in St James's Park in London PA UK news in pictures 2 August 2020 Lewis Hamilton drives with a puncture towards the finish line to win the Formula One British Grand Prix at Silverstone POOL/AFP via Getty UK news in pictures 1 August 2020 Arsenal's Pierre-Emerick Aubameyang celebrates with the trophy and teammates after winning the FA Cup, as play resumes behind closed doors following the outbreak of the coronavirus disease Pool via Reuters UK news in pictures 31 July 2020 People enjoy the sunny weather at a Bournemouth Beach Reuters

But the defence secretary found himself instead receiving a letter from the prime minister three days later accusing him of being the source of an unprecedented leak from the top-secret National Security Council. He was thought to have revealed that the Chinese telecommunications multinational Huawei was going to be allowed into Britain’s 5G network.

Mr Williamson had been interviewed last Friday for the investigation into the leak ordered by Sir Mark Sedwill, the cabinet secretary and national security advisor. The defence secretary had admitted speaking to the journalist who wrote the Huawei story for 11 minutes on the telephone, but has steadfastly denied telling him about the decision taken.

At the Faslane base, the defence secretary was a confident figure in his dark blue suit, white shirt and blue tie. He sounded untroubled, speaking about what the future held in defence and diplomacy.

HMS Vigilant at HM Naval Base Clyde in Faslane carries the UK’s Trident nuclear deterrent (PA)

Mr Williamson spoke about the nuclear umbrella and the relationship with the US: “When I speak to Pat Shanahan [the US defence secretary] he always tells me that Britain is their best and closest ally, not by just a little bit, but by an absolute league.

“This is also in terms of what we are doing in Afghanistan – when there was an opportunity to seize a moment, which country stepped up to the plate? The UK, working with the US to uplift troops, giving the president the space to move forward the opportunities there are for peace. I want to ensure this continues.”

Mr Williamson is not going to be in a ministerial position to shape the future any longer, certainly for the time being. But in the turbulent state of British politics, there may well be a new prime minister when one of the Vanguard-class submarines is on her months-long voyage deep underwater.

“There is a possibility of a different prime minister, and there are contingency plans for such a possibility,” acknowledged Commodore Bob Anstey as we looked at a metal safe on board HMS Vigilant.

The grey safe contained a smaller safe within which Mrs May’s letter is kept, along with the “Captain’s Key” with which the commander of the Vanguard-class submarine will start the mechanism for firing missiles.

He would give the order “you have my permission to fire” and turn the key, activating the launch with a trigger modelled on a Colt 45.

The UK is about to spend £40bn renewing the Trident programme, an issue highly contentious on strategic, economic and moral and religious grounds.

The arguments are that it is intrinsically wrong to use weapons that can cause carnage to humankind. It is also held that this country should not spend so much money on a nuclear programme when the defence budget for conventional forces has been shrinking regularly. They say we are protected by the American nuclear umbrella and, in any event, there are no needs for such weaponry when the threats now being faced are asymmetric ones of terrorism and guerrilla warfare.

Commodore Anstey maintained: “No one who serves on these submarines forgets the potential of what they can do. The hope, of course, is that we will never have to use the weapons. The idea is one of deterrence. Does it work? That of course is a matter of opinion, but we have not had a world war since we have had the nuclear deterrent.”

One key issue in the nuclear debate had been the one of “first strike” - carrying out the first nuclear attack rather than in response to one by the enemy, and the moral dilemma that presents.

Rob Forsyth, a Polaris submarine commander during the Cold War, recently described how he and his captain agreed on their first patrol “that we would not obey an unlawful order just because it came with the authority of the prime minister”.

Lead engineer technician Chris Randall of HMS Vigilant (PA)

Writing for the news platform Tortoise, he recounted: “What we were not prepared to do under any circumstance was automatically obey an order to fire first with the intention of destroying Soviet targets before they fired at us. This would almost certainly have been unlawful and neither of us had any wish to start a nuclear war based on incorrect intelligence of Soviet intentions.”

Commander Neil Lamont, the current commander of the submarine flotilla, reflected: “If an order comes to carry out an attack out of the blue then there would be obvious concern and we will need to carry out checks. But we would know what is going on in the world, that there is a crisis and what has led to this. But definitely, but we will check through the chain of command if it does not make sense.”

Commodore Anstey held: “In my view, anyone who refuses to follow the prime minister’s instructions on this matter should resign his commission. But you definitely have to have your crew with you. One thing one can’t do is stop them getting the news of what’s unfolding in the world, otherwise they will be very suspicious. You cannot carry out censorship on this issue.”

One issue where censorship is exercised is a very personal one for the crew – bad news coming from home. The submarine’s commander may well decide not to pass through news of deaths and accidents to sailors knowing that they would have to live with sadness and worry for months before the boat returns to port.

Theresa May sacks Gavin Williamson as Defence Secretary

“It is, of course, a very difficult decision and it undoubtedly has an impact on bereavement,” said Commodore Anstey. “We know that person faces a shock when they return home, but we have to pretend to him that everything is normal.

“You also have the situation that by the time he or she gets back home, others in the family have gone some way on the healing process, and they can’t understand why the others are not suffering as much from grief as him. But that is part of the life of being a submariner.”

All who serve in the submarine fleet are volunteers and despite the tribulations of being away from home for months – not seeing daylight, six bunks in a tiny cabin, and the prospect of being involved in a nuclear exchange – the drop-off rate is very low.