A driver suffering a heart attack was rushed to hospital by police officers who originally pulled him over thinking he was a wanted criminal.

The Whangārei man was weaving across Western Hills Drive at about 11am on Monday when officers out searching for a wanted person spotted his vehicle.

Whangārei response manager Senior Sergeant Rene Rakete said units pulled the vehicle over but quickly realised it was not the person they were seeking.

"The driver was clearly in distress, he was sweating and experiencing severe chest pains, which was making it difficult for him to control the vehicle," Rakete said.

The man explained to the officers he was trying to drive himself to the hospital for medical help.