Matt Hancock's affair with an aide came up on the doorstep in the Batley and Spen by-election, the chair of the Conservative party has said.
Amanda Milling said the scandal was among issues raised by voters, after Labour retained the West Yorkshire consituency by just 300 votes.
But she refused to be drawn on whether Boris Johnson's handling of the situation – which at first saw him dismiss the matter as ‘closed’ – had gone down badly in the seat.
"It was something that came up on the doorstep, I have to be honest about that," she told Sky News on Friday morning after the result.
"They had some issues over the weekend in terms of what happened. But Matt [Hancock] resigned and that was the right thing to do. There was a whole host of different issues that came up."
Ms Milling stated that "governing parties don't win by-elections" and argued that "actually taking it to such a small number of voters was itself a tremendous result", describing the result as "quite extraordinary".
Defending the government's approach, she added: "Matt did the right thing at the weekend, which was to resign. Within 24 hours of the story breaking we had a new health secretary and Sajid Javid is doing a tremendous job."
But asked specifically about Boris Johnson's handling, she said "There's a lot of love for the prime minister, he gets a tremendous lot of love on the doorstep. As I say, Matt did the right thing to resign and within 24 hours we had a new health secretary."
The Conservatives had hoped to win the seat, following a similar victory taking a constituency off Labour in Hartlepool in early May.
A poll released during the campaign had shown the Tories in the lead, but ultimately Keir Starmer's party managed to cling on despite a collapse in the Labour vote.
Mr Hancock resigned on Saturday following revelations that he broke social distancing rules while having an extramarital affair with an aide.
The aide had also been appointed a non-executive director at Mr Hancock's department and was meant to scrutinise him.
There are also separate allegations swirling around whether Mr Hancock used a personal email address for official work – thought to be problematic for reasons of both security and scrutiny.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies