A 56-year-old man has been charged with attempted murder and possession of an offensive weapon following an attack just after midnight in Leyton, east London, that left a police officer seriously injured in hospital.

Muhammed Rodwan, 56, from Luton, will appear at Thames magistrates court on Friday morning.

The officer, 28, remains in hospital in a serious but stable condition after being stabbed in the head. His injuries are not believed to be life-threatening. His family have been informed and are receiving support from Metropolitan police family liaison officers.

Scotland Yard said the officer was seriously injured but would recover. He had attempted to stop a van suspected of having no insurance in Leyton just after midnight on Thursday. The officer, who has about a decade of experience, managed to use his Taser despite being brutally injured in the “sudden and brutal” assault which lasted just seconds.

He was treated by colleagues and paramedics in Leyton High Road as his uniform lay next to him on the ground. He was later taken to hospital by ambulance, police said. He was treated for a wound to the side of his head, which required stitches, and an injured hand. His next of kin were informed. Officers later carried out a forensic examination of the van.

Insp Julia James from the north-east command unit said: “This was a sudden and brutal attack on a uniformed officer carrying out their duties. What began as a routine vehicle stop transformed very quickly and unexpectedly into an unprovoked attack with a weapon.”

Witness Muhammad Faisal said he and his family were woken by the noise outside their flat and saw up to 15 police cars and an ambulance.

“The scene was shocking,” he said. “We saw someone lying on the road. Next to him was his police uniform … We didn’t see the wound, but we saw a lot of blood. I saw one police officer was holding a knife. It was a machete … around a foot long.”

The Metropolitan Police Federation chair, Ken Marsh, said: “This is horrific news. Police officers across London are out there every day at risk protecting the public – and sadly, yet again, a Metropolitan police officer has suffered a severe injury on duty. Enough is enough. Police officers should be going home at the end of their shifts. Not to hospital.”

The prime minister, Boris Johnson, said: “What this underscores for me is the bravery of our police, people who actually go towards danger to keep us safer.”

The home secretary, Priti Patel, tweeted: “Absolutely horrified by the shocking stabbing of one of our brave police officers in Leyton overnight. His courage in the face of danger shows how police put their lives on the line to protect us every day. I wish the officer a full recovery & my thoughts are with him.”

London’s mayor, Sadiq Khan, tweeted: “I am utterly appalled by this sickening attack. The men and women who serve in our police force in London are the best in the world, and their courage and dedication is inspiring.”