Tensions between the Metropolitan police and London's mayor, Boris Johnson, flared yesterday after a day of turmoil saw the country's leading anti-terrorist officer resign following a security blunder.

The departure of Assistant Commissioner Bob Quick was announced by Johnson on Radio 4, pre-empting a public statement from Scotland Yard and angering both the Met and the home secretary, Jacqui Smith.

Johnson's decision to go further and release details of Quick's replacement - John Yates - before Scotland Yard was able to put out its official statement is understood to have infuriated senior Met figures, and could have had serious security implications.

It is the first time since Sir Paul Stephenson took over as commissioner, appointed by Johnson, that the mayor's behaviour has so obviously clashed with Scotland Yard, and it confirmed the concerns of many within the police force that Johnson believes he is running the organisation.

Johnson's official spokesman, however, denied any spat between the commissioner and the mayor, saying both had spoken after the radio broadcast.

Sources indicated the home secretary was irritated by Johnson's behaviour in announcing the appointment of a national lead on counterterrorism. The dispute puts the spotlight on the uneasy tripartite relationship between a Tory mayor, a Labour home secretary and a police commissioner appointed by them both.

Within Scotland Yard, the departure of another senior officer was met with weary resignation. Sir Ian Blair; Andy Hayman, the former head of counter-terrorism; his deputy, Peter Clarke; Assistant Commissioner Tarique Ghaffur; and before him Deputy Assistant Commissioner Brian Paddick - all have departed in the last few years. Stephenson has been left with a depleted top team at a time when the force faces serious challenges, not least over the alleged use of violent tactics at the G20 protests last week, but also the serious failings identified in rape investigations dating back several years.

Yates, whose reputation as a safe pair of hands and a savvy politician is likely to have made him the only candidate for the role of counterterrorism lead, takes over with immediate effect.

His previous role, heading the specialist crime directorate, where experienced detectives investigate homicide, serious and organised crime, child abuse and now rape, will be taken by Deputy Assistant Commissioner Janet Williams, a former head of special branch and one of the Met's two most senior women officers.

Quick formally tendered his resignation to the Metropolitan Police Authority yesterday morning after carrying clearly visible top-secret security documents about an imminent anti-terror raid in view of photographers outside Downing Street.

Because of his blunder, anti-terror raids in Manchester, Liverpool and Clitheroe, Lancashire, had to be brought forward by several hours, and according to senior sources were "compromised".

At 7.30am yesterday, Johnson was told of his decision. According to his official spokesman he had a conversation with Stephenson, and with his own aides, and went on air 40 minutes later to make the announcement.

His spokesman said Stephenson was concerned that there should be no gap between announcing the departure of Quick and the appointment of a new counterterrorism lead, and therefore Johnson made the announcement about the appointment of Yates.

Quick resigned after the home secretary withdrew her support on Wednesday following his mistake. Stephenson is understood to have made clear to Johnson that Quick's position was untenable, leading to his resignation.

Yesterday morning the Yard was about to make the announcement of Quick's departure, when Johnson appeared on Radio 4's Today programme to do it for them.

Smith had wanted the police to announce his departure after discussing Quick's position, and was said to be angry that Johnson had made the announcement while the anti-terror raids were still going on.

Stephenson made no comment on the tensions yesterday. He released a statement saying Quick had been a "tremendous police officer", "a friend and colleague" who had accepted he had made "a serious error".

Quick spoke to friends on Wednesday night before his resignation. In his statement, he said: "My action could have compromised a major counterterrorism operation. I deeply regret the disruption caused to colleagues undertaking the operation and remain grateful for the way in which they adapted quickly and professionally to a revised timescale."

Caught on camera

Bob Quick is not the first to be caught out by the long lens of the press:

• Last year, housing minister Caroline Flint was photographed on her way to brief cabinet colleagues on plunging property prices. Her briefing document was in a clear folder, showing, as the photographs revealed, that the housing market was expected to drop by at least 5% to 10%, but "we can't tell how bad it will get"

• George Bush was caught out when a Reuters snapper spied him writing an important note to Condoleezza Rice: "I think I may need a bathroom break? Is this possible?"

• Hazel Blears once unwittingly revealed a printed email disclosing the BBC's hopes for making Gordon Brown the star of a new reality show, Junior PM

• In 2003, at the height of the storm over the "sexed-up" Iraq dossier, Tony Blair was pictured with his briefing notes, ready for PMQs. The green tags revealed which subjects were on his mind. One stood out - Gilligan