Nick Gargan, the embattled chief constable of Avon and Somerset Police, has resigned, it has been confirmed.
Mr Gargan's resignation was accepted by police and crime commissioner Sue Mountstevens with immediate effect.
There had been mounting pressure on Mr Gargan to quit after was found guilty of eight charges of misconduct and an independent panel recommended he receive eight final written warnings.
Ms Mountstevens had begun a process to require Mr Gargan to resign from his £150,000 job.
He was suspended on full pay in May last year after allegations he had made inappropriate advances to female colleagues.
During an investigation by the police watchdog, Mr Gargan was further accused of leaking internal emails and using his work phone to send, receive and store intimate images.
Since then, the force's three most recent former chief constables, the local police federation and hundreds of people through a petition called for Mr Gargan's resignation.
But some local MPs have claimed it is a "witch hunt".
Ms Mountstevens started the process of requiring him to resign or retire using section 38 of the Police Reform and Social Responsibility Act 2011, which was backed by Sir Tom Winsor, Her Majesty's Chief Inspector of Constabulary.
Mr Gargan will leave his position with three month's salary in lieu of notice as the terms of his contract state.
Ms Mountstevens said: "I have accepted Mr Gargan's resignation with immediate effect. I think this is in the best interests of the Constabulary, and residents.
"It also means that the protracted and lengthy section 38 process will end immediately and no further legal expense will be incurred.
"I have agreed to pay Mr Gargan three-month's salary in lieu of notice as the terms of his contract state.
"This was not a decision I took lightly and I have considered it very carefully however in order to bring the legal proceedings to a close this is the most cost effective outcome.
"It also means that I can begin the process of recruiting a new chief constable as soon as possible and the organisation can move on.
"Temporary chief constable Gareth Morgan will continue to lead the constabulary while a recruitment process takes place.
"I would like to thank Gareth for his leadership and the valuable contribution he makes to the organisation."