One of Britain’s top spy chiefs quit after it emerged that he helped a paedophile Catholic priest avoid jail, The Mail on Sunday can reveal.

Prime Minister Theresa May was last night accused of a cover-up over the scandal as she knew of GCHQ director Robert Hannigan’s connection to the child sex offender when he stood down in 2017.

At the time, Mr Hannigan had cited ‘family reasons’, with this crucial link kept secret.

The high-flying civil servant, who was lauded for his role in striking peace in Northern Ireland, stunned Whitehall with his exit after just two years in charge of GCHQ.

Theresa May was accused of a cover-up over the scandal as she knew of GCHQ director Robert Hannigan’s (pictured) connection to the child sex offender when he stood down in 2017

In his resignation letter to Boris Johnson, who as Foreign Secretary had oversight of GCHQ (pictured), Mr Hannigan wrote: ‘After a good deal of thought I have decided that this is the right time to move on and to allow someone else to lead GCHQ through its next phase’

This newspaper has learned he stepped down after the National Crime Agency discovered that he helped a close family friend avoid a custodial sentence for possessing 174 child pornography images.

After Mr Hannigan provided a character reference for Father Edmund Higgins at his 2013 trial, the priest’s eight-month sentence was suspended. The judge said Higgins had ‘struggled with his sexuality’. But Higgins went on to reoffend, and during an NCA probe his links to Mr Hannigan were discovered and No 10 was alerted.

The powerful mandarin gave the reference ‘in good faith’ a year before his appointment as director of the 5,000-strong Government Communications Headquarters, the notoriously secretive eavesdropping agency.

After his conviction, Edmund Higgins, who had served at St Elizabeth’s Church in Richmond, South-West London, was defrocked and changed his name to Edmund Black

With the Prime Minister’s blessing, he was allowed to resign on January 23, 2017, citing family commitments. Anonymous briefings were given to the media that he would be caring for sick relatives. That same year, Mrs May said: ‘The sunlight of transparency acts… as an important check and balance, and helps ensure the highest standards of public life among senior Government representatives.’

Last night Mr Hannigan, who began to train as a priest before joining the civil service, confirmed that Higgins had been a family friend for two decades. But he admitted his ‘judgment was completely wrong’ in providing the character reference.

After his conviction, Higgins, who had served at St Elizabeth’s Church in Richmond, South-West London, was defrocked and changed his name to Edmund Black, but continued to offend.

The Mail on Sunday has learned that No 10 was alerted in early 2017 that the NCA was investigating Higgins as part of a major probe into online chatrooms that hosted abuse of babies. His connection to Mr Hannigan was highlighted to figures at the very top of Government, including the Prime Minister.

Mr Hannigan offered to step down to avoid dragging GCHQ into the scandal but the significant reason behind his departure was never made public. Even senior officials within the Foreign Office, GCHQ and Cabinet Office were unaware.

In his resignation letter to Boris Johnson, who as Foreign Secretary had oversight of GCHQ, Mr Hannigan wrote: ‘After a good deal of thought I have decided that this is the right time to move on and to allow someone else to lead GCHQ through its next phase.’ He added that his job ‘demanded a great deal of my ever patient and understanding family, and now is the right time for a change in direction’.

How his diamond table rescued the Ulster peace deal Seat solution: Ian Paisley, far left, and Gerry Adams, far right, at Mr Hannigan’s diamond table Robert Hannigan’s meteoric rise to the top of the British Establishment began with an ingenious diamond table that helped unlock power-sharing in Northern Ireland. During testy negotiations in Belfast in 2007, Republicans demanded they must sit next to Unionists, but they in turn demanded they must sit opposite their former adversaries. As an adviser to Tony Blair, Mr Hannigan came up with a diamond-shaped table that allowed the key players to sit both opposite and next to each other, breaking the deadlock. He quickly rose up the diplomatic ranks, counselling Gordon Brown and David Cameron on security affairs, before being appointed head of the country’s largest spy agency GCHQ, with a seat on Whitehall’s all-powerful Joint Intelligence Committee. At the time, Mr Hannigan was named the country’s third most powerful Catholic by religious newspaper The Tablet, which noted that he ‘enthusiastically follows hurling and Gaelic football.’ Before entering the Civil Service, Mr Hannigan trained to be a priest at Allen Hall seminary in Chelsea. But friends say he ‘fell in love and could not go down that path’. It was through his wife that he first met Father Edmund Higgins, a notorious paedophile. That friendship would help destroy Mr Hannigan’s otherwise blemish-free career when a sister intelligence agency discovered his past support for the clergyman – support which he would come to regret. Mr Hannigan has since gone on to take a host of jobs in the private sector, commenting publicly on national security and most recently defending Chinese technology firms. Advertisement

Mr Johnson replied: ‘You have led the renewal of some of our most important national security capabilities. I wish you the very best for your future career.’

Last night, Scottish National Party MP Pete Wishart said the ‘shocking episode reeked of a cover-up’, adding: ‘The Prime Minister is immersed in this up to her eyes.

‘No 10 must give a full account of what they knew, when they knew and why they have failed to do so before. The Prime Minister must come to the Commons tomorrow and explain the Government’s role in this appalling episode.’ Government insiders said in Mr Hannigan’s defence the truth was not revealed because the investigation into Higgins was still active. Higgins’s home was raided by the NCA the following January.

However, the truth remained classified long after Higgins was charged. He was jailed for 31 months in June 2018 in a case the NCA described as ‘horrendous’.

They had caught Higgins boasting online of his sexual interest in babies and he later confessed to possessing and making child abuse images. He visited chatrooms when child sex abuse was being shown, and in May 2016 he hosted a chatroom where nine videos were played showing horrific child abuse, with one victim thought to be just three months old. When his house was raided, the NCA found more than 800 illegal images, 201 of which were in the most severe category. Even while he was on bail he returned to the depraved online forums to reoffend.

After his conviction, senior NCA officer Martin Ludlow said: ‘Every time these horrendous images are shared that child is victimised… [Higgins] has shown no remorse. He went out of his way to encourage others to view and share images.’

Mr Hannigan has since gone on to a lucrative career in the private sector. He said last night: ‘Mr Higgins had been a close family friend for 20 years. After he pleaded guilty to child sexual imagery offences in 2013, we submitted a character reference on our knowledge of him to the court in good faith.

‘His subsequent criminal actions appalled us and have shown that our judgment was completely wrong. When I later became director of GCHQ, all the correct steps were taken in relation to my involvement in this case and this was verified by Government lawyers. This is a personal family matter. We will not be making further comment.’