The officer was knocked out and collapsed, bleeding from his nose and mouth.
"The second officer, who had been speaking with the two passengers in the car, tried to restrain the offender but a struggle ensued, during which time the offender had to be pepper sprayed. The offender then fled," a spokesman said.
Other police units flooded the area and a short time later an eagle-eyed member of the public phoned police to report that there was a man washing his face in a nearby creek.
"This was the offender attempting to wash his face after being pepper-sprayed," police said. The injured officer was taken to Waitakere Hospital with possible concussion, facial and lower back injuries.
He is expected to be off work for the next few days.
"This was a gutless assault on an officer who was simply doing his job," said Inspector Steve Kose, Acting Area Commander of Waitakere Police.
"These two officers were in fact doing what we call 'prevention activities' - performing a high visibility patrol to deter criminals and keep our communities safe.
"An assault like this should not be seen by anyone as simply being part of a police officer's job and I know the public will share their disgust at this."
A 21-year-old man has been charged with aggravated wounding and will appear at Waitakere District Court tomorrow.NZME.