The deputy director-general of MI5 has been named as the new head of GCHQ.

Jeremy Fleming will succeed Robert Hannigan as director of the agency often referred to as Britain’s listening post.

His appointment was announced on Monday by Foreign Secretary Boris Johnson, who said he is a “dedicated public servant whose work over two decades in the intelligence services has helped to keep our country safe”.

Congratulating the incoming director, Mr Johnson said the “skill and ingenuity of the UK intelligence community are critical to defending Britain from cyber attacks, terror plots and other activities that threaten us and our allies”.

Mr Fleming, a career MI5 officer, will be in a public-facing role for the first time once he takes up the post around Easter.

He said: “It is a great privilege to be asked to lead GCHQ as it approaches its centenary in 2019. The organisation has a distinguished past and an increasingly important role to play in keeping Britain safe in the digital age.

“From managing cyber risks posed by nation states to preventing terror attacks, keeping our children safe online and supporting our armed forces, the exceptional men and women of GCHQ operate on the new front line of global challenges.”

He paid tribute to Mr Hannigan, who announced he is to step down after two years as director in January, saying he has led the agency “through the transformation of some of our most important national security capabilities”.

Mr Hannigan said: “I’m delighted that the Foreign Secretary has appointed Jeremy Fleming to be the new director.

“I’ve known Jeremy for many years and he is a great friend and colleague. He comes with deep intelligence experience and expertise.”