The officer was stabbed about midnight on Thursday after attempting to stop a van at the junction of Coopers Lane and Leyton High Road in Leyton, east London.
Police said the vehicle's driver, aged in his 50s, failed to stop and then got out of the van and injured the officer with the machete.
The policeman managed to use his Taser despite having been stabbed, with the alleged attacker then arrested by another officer.
The injured officer, aged in his 30s, was taken to hospital by ambulance.
The Metropolitan Police said his condition is believed to be critical but stable, and his next of kin have been informed.
Police have arrested the driver, who did not require hospital treatment, on suspicion of grievous bodily harm.
A crime scene remains in place in the area.
Police have said there is nothing to suggest the incident is terrorism related.
North East Command Unit's inspector Julia James described the assault as a "sudden and brutal attack".
She added: "What began as a routine vehicle stop has transformed very quickly and unexpectedly into an unprovoked attack with a weapon.
"Our thoughts are with the injured officer and his family and we wish him a full recovery.
"I would like to commend his bravery and resilience especially as he managed to draw a Taser, despite being repeatedly stabbed, to prevent the suspect harming anyone else and to protect himself from further injury," she said.
"This incident highlights the very real risk that police officers can be confronted with on a daily basis and the courage and professionalism officers demonstrate when doing their job.
Police have asked anyone who witnessed the incident to call 101 or Crimestoppers anonymously on 0800 555 111 and quote reference CAD3/8August.