Munira Mirza worked with Johnson when he was mayor of London from 2008 to 2016.
An influential aide to Boris Johnson quit on Thursday after the British prime minister made a widely debunked claim attacking the opposition Labour leader over a notorious paedophile.
The departure of Johnson's long-term ally Munira Mirza as head of Downing Street's policy unit deepened the prime minister's woes, after police launched an investigation into a series of lockdown-breaching parties.
He has faced demands to resign over the "partygate" affair, and came under fresh attack after trying to link Labour leader Keir Starmer to veteran TV host Jimmy Savile, who died in 2011 aged 84.
While in life Savile was seen as a widely loved presenter, after his death accusations emerged that he had been a serial abuser of hundreds of children, but never faced prosecution.
In parliament on Monday, Johnson shocked many on his own side when he aired a conspiracy theory prevalent among far-right groups that Starmer had personally failed to prosecute Savile.
Starmer, a former lawyer, was director of state prosecutions in England and Wales from 2008 to 2013. Under his watch, police decided not to press charges against Savile despite widespread suspicions about his behaviour.
Starmer was not personally involved in the decision, and he accused Johnson of "parroting the conspiracy theories of violent fascists to try to score cheap political points".
Johnson belatedly tried to backtrack late Wednesday, after strong criticism from Tory MPs, sections of the media and a lawyer representing victims of Savile.
But Mirza said that did not go far enough.
"There was no fair or reasonable basis for that assertion," she wrote in her resignation letter, according to the Spectator magazine.
Johnson's remark in parliament "was an inappropriate and partisan reference to a horrendous case of child sex abuse", she said, noting that the prime minister had yet to apologise.
"You are a better man than many of your detractors will ever understand, which is why it is so desperately sad that you let yourself down by making a scurrilous accusation against the leader of the opposition."
Mirza, who was once a member of the now-defunct Revolutionary Communist Party, worked with Johnson when he was mayor of London from 2008 to 2016, joining him in Downing Street from 2019.
He once praised her as a "brilliant thinker". She was a leading proponent of Downing Street's "culture wars" attacking "woke" thinking.
Downing Street confirmed her departure, saying that Johnson was "grateful for her service and contribution to government".
Dominic Cummings, Johnson's former chief aide turned bitter foe, said Mirza's resignation was an "unmistakable signal the bunker is collapsing" as the "partygate" allegations swirl.
Asked about Mirza's departure, finance minister Rishi Sunak told a news conference she was a "valued colleague".
"Being honest, I wouldn't have said it and I'm glad the prime minister clarified it," he said of Johnson's comments on Savile.