IT took three-and-a-half years, and investigations costing from £3.5 to £7m, depending on whose figures you believe, but Robocop has finally been worn down. Ray Mallon's decision to resign from Cleveland Police has brought an end to a saga which has proved a constant embarrassment to the force.

Ever since he was suspended from duty in December 1997, the shadow of the former head of Middlesbrough CID has loomed over his former colleagues and superiors, not least through his record in reducing crime. Their failure at first to make any criminal charges stick, and then to deal with alleged disciplinary offences, exposed them to ridicule and contempt.

While Mr Mallon is reserving a detailed explanation of his decision to quit until a news conference this morning, it is clear there are two main reasons for the move.

One is that he has been approached to stand for the position of mayor of Middlesbrough. A referendum in October will give the townsfolk a chance to vote on whether to have an elected mayor, but if he is to campaign for a "yes" vote, he needs to resign from the force now.

It is not the first time Mr Mallon has shown evidence of political ambition. Shortly after the 1997 election, the poll which saw him feted by politicians from both sides for his success in lowering crime, he spoke of a desire to enter politics once his 30 years in the police were up. And in December last year, marking three years of his suspension, he talked about standing for mayor of Hartlepool, the town where he first made his reputation and which he sees as a spiritual home.

He told The Northern Echo then: "I want to serve the community. It's not about self-ambition, it is about the community. I owe the public so much for the support they have given me and my family over the last three years so, when I eventually leave the police force, I want to try and repay them."

More recently, he was on the verge of quitting the police to stand against Peter Mandelson as MP for Hartlepool in this year's General Election. The former Detective Superintendent had told The Northern Echo he was intending to challenge the architect of New Labour, who had twice resigned from the Cabinet. In the end, he decided against it and did not hand in his resignation, perhaps reluctant to come head-to-head with a politician he had previously spoken of with respect, perhaps recognising the tide was still flowing strongly in New Labour's favour.

But, on this occasion, he is going through with it, and the timing has perhaps as much to do with running out of cash as with October's referendum. His insurance through the Superintendents' Association only runs to £100,000 and, after three-and-a-half years of wrangling, it is now exhausted.

If he were to remain in the force, and go through the disciplinary procedure, the expected eight-week hearing would cost him £80,000, money he would have to find from his own pocket and which he could not claim back even if he won. Shelling out £80,000 to prove a point may have seemed too high a price to pay.

On top of this, it has also become increasingly difficult to see how Mr Mallon could have returned to a force which had made it clear it didn't want him. In public, he remained confident he would win back his job and be able to return, but the prospect of working with commanding officers who seemed determined to prise him out, appeared increasingly far-fetched.

Throughout Ray Mallon's ordeal, Lord Mackenzie of Framwellgate has been a staunch supporter. The former chairman of the Superintendents' Association, ex-Durham Police officer and Home Office advisor, has repeatedly criticised the length of time the inquiry has taken.

Operation Lancet, the longest internal inquiry into any British force, saw 61 officers investigated over allegations including supplying drugs in order to win confessions and assaulting suspects. In the end, the Crown Prosecution Service decided there was not enough evidence to bring criminal charges and Mr Mallon was left facing 14 disciplinary charges, one of eight officers still suspended.

"I fully support his decision to resign. He has suffered a grave injustice in my view and I think the length of time that the Lancet inquiry has been running is simply unacceptable," says Lord Mackenzie. "Police officers are entitled to justice, the same as anybody else, and the police complaints system clearly needs substantial reform.

"I welcome his decision to seek nomination as the mayor of Middlesbrough. I think he will be an excellent candidate and the people of Middlesbrough are very fortunate to have a champion of the quality of Ray Mallon seeking their support."

But, by resigning at this stage, Ray Mallon ensures there will be no satisfactory conclusion to the investigation which has dogged what should have been his most glorious years.

It was in Hartlepool, after his appointment as Detective Chief Inspector in April 1994, that he was first able to put his Zero Tolerance policy into operation and, by the end of the following year, crime had been reduced by 20 per cent.

Its success was replicated when he was promoted to Middlesbrough in November 1996. His seemingly-rash pledge to cut crime by 20 per cent within 18 months or resign took the community by storm, and in the end the figure was reached with nine months to spare. He became the flavour of the moment, courted by every politician who wanted to seem tough on crime and tough on the causes of crime. Just months later, he was suspended.

But it would be hard to criticise a man for walking away when he has spent three-and-a-half years standing firm.

"I think it is remarkable that Ray Mallon has managed to stay in the field for so long," says Lord Mackenzie. "Lesser men would have walked away with back injuries or stress, and probably claimed substantial compensation.

"In my view there is a conclusion. The allegations originally were talking about most serious offences, including corruption and assault, they were all of a criminal nature. But, 14 months ago, he was cleared of any criminal charges. He has been completely vindicated, I'm delighted for him and now he needs to get on with his life."

But, the problem still remains that, with Mr Mallon's departure, there is no tangible result from all the money, not to mention all the time, that has gone into the investigation. And, far from relieving Cleveland Chief Constable Barry Shaw of his biggest headache, it could leave a permanent and unanswered stain on the force.

But, although the force itself may not get to pass judgement on the man dubbed Robocop, by putting himself up to the public vote, Ray Mallon is giving the public the chance to have the last word.