Ottawa police said they pulled a black sedan over around the intersection of Bank Street and Heron Road at about 3 p.m. Saturday.
"He became very irate and argumentative," said acting Insp. Sean McDade of the Ottawa police.
"At one point he exited the vehicle, became assaultive and punched one of our officers in the face."
The man then ran through four lanes of traffic and drew gunfire from a police officer from another agency, according to witness Peter Dickson.
"He bolted, he ran around the car and right into traffic on Bank [Street] — bumped into the side of a car in the second lane. All of a sudden this fellow appears out of nowhere out of this parking lot, he was standing on the grass pointing a pistol at the suspect," Dickson said.
"There was a great big crack, there was a gun fired."
McDade said two Ottawa police officers used stun guns on the man, the first one missing but the second one hit its target.
Bank Street was closed for more than four hours as police dogs and RCMP explosives disposal officers searched the sedan.
Police are also investigating why a shot was fired.
The officer who was punched was taken to hospital with facial injuries.