The head of London’s Metropolitan Police, Cressida Dick, said she is resigning Thursday after a string of controversies that undermined public confidence in the force and prompted a falling out between her and the capital’s mayor.

Mayor Sadiq Khan had recently threatened to oust Dick from her role, saying she wasn’t doing enough to reform the Metropolitan Police, Britain’s largest police force, and tackle growing accusations of misogyny and racism.

Also Read: Europe faces biggest security crisis: Boris Johnson as Ukraine tension deepens

Khan said late Thursday it was clear the only way to overhaul the force was to have “new leadership right at the top of the Metropolitan Police.”

In a statement, Dick, who has headed the force for four years and is the first woman to lead Scotland Yard, said it was with “huge sadness” that it has become clear that Khan “no longer has sufficient confidence in my leadership to continue.”

“He has left me no choice but to step aside as Commissioner of the Metropolitan Police Service,” she said.

Dick added that she will stay in her role for a short period to ensure the force’s stability while a replacement is found.

Also Read: Indian Prime Minister Narendra Modi tops the Global Leader Approval list third year in a row

A report last week by the Independent Office for Police Conduct, the police watchdog, condemned misogyny, bullying, discrimination and sexual harassment among officers, most of them based in central London’s Charing Cross police station.

The report cited officers joking about rape and using other offensive language in social media messages, and said the incidents were part of a wider culture that can’t be blamed on a few “bad apples.”

Also Read: UK Chancellor Rishi Sunak admits attending lockdown party: report

Khan said last week he was “not satisfied” with Dick’s response to calls for change following scandals including the killing of a woman by a serving police officer and the behavior of officers cited by the police watchdog.

“Last week, I made clear to the Metropolitan Police Commissioner the scale of the change I believe is urgently required to rebuild the trust and confidence of Londoners in the Met and to root out the racism, sexism, homophobia, bullying, discrimination and misogyny that still exists,” Khan said.

He thanked Dick for her 40 years of policing service.