Ms Dick, who was assistant commissioner in charge of specialist operations, including counter-terrorism, between July 2011 and summer this year, is to take up a new role at the Foreign and Commonwealth Office (FCO).

The assistant commissioner, who was in charge of specialist crime and operations for the last few months of her career after being moved from counter-terror responsibilities, joined the Metropolitan Police in 1983.

Ms Dick, 54, who has degrees from Oxford and Cambridge, said: "I first joined the Met in 1983 and have loved my time as a police officer in London.

"It has been a wonderful privilege to work in such an extraordinary organisation and with such fabulous people. I feel very lucky to have done so. I will miss you all."

The assistant commissioner was national lead for police counter terrorism for three years, including during the Olympics and took on command roles in the Met's response to 9/11 attacks, the Tsunami and after the 2005 bombings.

She has led many of the force's highest profile and most complex crime investigations, including phone hacking, Parliamentary expenses and Official Secrets Act inquiries.

But Ms Dick first came to national prominence in July 2005 when she was in charge of the operation that led to the fatal shooting of Brazilian Jean Charles de Menezes, who was wrongly identified as an attempted suicide bomber. A jury cleared her of any blame in his death.

The assistant commissioner, who is also President of the British Association of Women Police, will leave the Met on January 19.

Met Commissioner Sir Bernard Hogan-Howe said: "Cressida Dick has been a fantastic leader in the Metropolitan Police and takes on some of the most difficult roles in policing.

"She is a role model for women across the service. We wish her well for the future."

The FCO confirmed Ms Dick had been appointed at the department but would not confirm in what role.