The Metropolitan Police's Assistant Commissioner for Specialist Operations and the national lead for counter terrorism has announced his retirement.
Mark Rowley will be leaving policing after 31 years in service.
In June 2014 he was appointed as head of the force's Specialist Operations and national lead for UK Counter Terrorism Policing - the day before Daesh leader Abu Bakr al-Baghdadi announced the establishment of a so-called "worldwide caliphate".
His work has included working with MI5 and other intelligence agencies to successfully stop 23 planned attacks since the murder of Lee Rigby in Woolwich in 2013 - including 10 since March 2017.
He will continue in his role until March, when his successor will take on responsibility for the job.
Announcing his retirement, Mr Rowley said: "I am as proud of the police service today as I was when starting on the beat in Birmingham in 1987.
"Every day I continue to witness the selfless, unwavering commitment of all involved in protecting and serving the public.
"I really have loved every role I have performed, but three stand out for me: those first days as a West Midlands police constable; and later as chief constable of Surrey, an innovative force delivering pioneering community policing.
"However, my time in the Met, leading the National Counter Terrorism Policing network at the most extraordinary time has been the greatest privilege.
"It was immensely sobering, but none the less the greatest honour for me, to lead the response to last year's terrible events in Manchester and London, where I witnessed the extraordinary bravery and compassion of UK policing.
"It is therefore no surprise to me that Her Majesty's Inspectorate of Constabulary and Fire and Rescue Services recently noted, the public's confidence in the police to protect them against terrorism has, in the toughest year in decades, increased markedly.
"It has also been a privilege to have worked with two talented Met Commissioners, numerous chief constables around the country and an outstanding Director General of MI5 throughout my tenure.
"I now plan to catch my breath and then pursue fresh challenges."
Prime Minister Theresa May said: "Last year the United Kingdom suffered some of the worst terrorist attacks in our history and I would like to thank Assistant Commissioner Mark Rowley for his leadership and the reassurance he offered to the public in responding to these horrific incidents.
"AC Rowley's dedication to protecting public safety and tackling the evils of terrorism, both throughout his career and as policing lead for counter-terrorism, has served as an example of the professionalism of our police forces and I am grateful to him for his years of service."