LONDON, England (CNN) -- The UK's top police officer, Metropolitan Police Commissioner Ian Blair, announced his resignation Thursday after being urged to step down by London mayor Boris Johnson.
Blair: "It has been the proudest task of my life to lead the men and women of the Metropolitan Police."
Blair, 55, resigned in a speech broadcast live on British television, saying his departure came "not because of failure or pressures. I am resigning in the best interests of the people of London and the Metropolitan Police Service."
Blair will officially step down on December 1, and his deputy, Paul Stephenson, will become acting commissioner until a new commissioner is appointed, the Metropolitan Police said.
Just five months into the commissioner's job, Blair was forced to deal with the deadliest attack in Britain since World War II. On July 7, 2005, four bombs were detonated aboard three subway trains and a bus in London during the morning commute, killing 52 people and wounding more than 700.
The attacks also led to the incident that would mark the beginning of the end for Blair.
Two weeks after the bombings, four bombers tried but failed to carry out similar attacks on London's transport system, putting the city and country even more on edge. Officers staking out a suspect's home in south London saw and followed Brazilian Jean Charles de Menezes, 27, wrongly believing he was a suspect.
The officers trailed de Menezes as he traveled on a bus and into a subway station, where they chased him and shot him dead.
The fatal case of mistaken identity led to widespread criticism of the police -- and Blair in particular -- for their handling of the case.
In November 2007, a jury found the police service guilty of breaching health and safety laws for the de Menezes shooting. Earlier last year, a report by the Independent Police Complaints Commission accused London police of misleading the public by saying de Menezes had raised suspicion when in fact, the commission found, he had done "nothing out of the ordinary."
Hours after the shooting, Blair held a news conference and said de Menezes had refused to comply when challenged by police. The report said that in the following hour, the police anti-terror chief, Andy Hayman, told crime reporters that de Menezes was not one of the bombers, but did not share that information with senior police officers.
Blair insisted he wasn't told until the following morning that an innocent man had been killed, the report said.
Hayman resigned last December.
More recently, Blair faced allegations of racism from one of his senior officers. Assistant Commissioner Tarique Ghaffur accused Blair in August of repeated acts of racial, religious and age discrimination, and announced he was suing his boss.
Blair faced further scandal when he announced Ghaffur's suspension two weeks later. The commissioner said the move had nothing to do with the lawsuit, but instead was due to Ghaffur's actions in holding a news conference to announce the suit and "conducting a media campaign."
Blair said he wanted to stay until the end of his tenure in 2010, but said new London Mayor Boris Johnson "made it clear that he wished there to be a change of leadership." The commissioner, he said, needed the confidence of the mayor and home secretary, and he could not continue without it.
Blair joined the Metropolitan Police in 1974, then rejoined again in 1993 and 2000, according to a biography posted on the police Web site. In 2000, he assumed the deputy commissioner's post, where his responsibilities included anti-corruption work and diversity management.
Blair was awarded the Queen's Police Medal for Distinguished Service in 1999, and in 2003 was awarded a knighthood in the Queen's Birthday Honors for his services to policing before becoming commissioner in 2005.
CNN's Bridget Fallon contributed to this report.