Boris Johnson has apologised to “everybody who has a bad experience” in the NHS after a four-year-old boy had to sleep on a hospital floor.

Sarah Williment covered her son, Jack, with coats to keep him warm as he waited for a bed at Leeds General Infirmary, where she had taken him last Tuesday fearing he had pneumonia.

He was eventually moved to a ward, where he waited for five hours on a trolley before a bed was found at 3am, Ms Williment told the Daily Mirror.

Diagnosed with flu and tonsillitis, Jack was allowed to be taken home at lunchtime.

Asked about the incident during an interview on LBC, the Prime Minister said: “Of course I sympathise very much and I apologise to everybody who has a bad experience.

“By and large I think the NHS do an amazing job and I think that they deserve all praise for the service they provide – but they do need investment and that’s why we’re doing it now.

“But they need investment from a One Nation government that really cares and understands – that’s us that cares and understands – and you need long-term funding.”

Ms Williment, 34, told the Mirror she would now switch allegiance and vote Labour in Thursday’s election, owing to her concerns about the state of the NHS.

She said: “I am frustrated about the system and the lack of beds, which I am presuming is due to a lack of funding to the NHS to deliver the services that are required.”

The Prime Minister had faced calls to apologise to the family from shadow health secretary Jonathan Ashworth.

He said: “Boris Johnson should personally apologise to Jack and his family. A decade of Tory cuts has brought us to this crisis in our NHS.

“If the Tories win on Thursday, patients including children will suffer five more years of this. We need a Labour government to save our NHS.”