A 39-year-old man facing four charges after allegedly punching an officer in the face on Saturday afternoon was under RCMP surveillance, sources tell CBC News.

The man was "recently" put under surveillance by one of the RCMP's Integrated National Security Enforcement Teams.

Their mandate is to monitor "individuals and entities that are a threat to national security" and bring them to justice, according to the RCMP website.

RCMP were working with Ontario Provincial Police on the case.

Man had been banned from one Ottawa mosque

Members of Ottawa's Muslim community said the man had been disruptive at two different mosques in recent months.

Acting Inspector Sean McDade Ottawa Police

Acting Insp. Sean McDade of the Ottawa Police said an "irate and argumentative" man punched an officer in the face Saturday. (CBC)

Abdulhakim Moalimishak, president of the As-Salaam mosque, said the man was banned from his mosque two months ago had attempted to assault the Imam and that he had espoused extremist views.

As-Salaam Mosque reported him to police and asked for police to help bar him from the premises.

Then on Friday, two days after the shootings at the National War Memorial and Parliament Hill's Centre Block, members of a different congregation told CBC News that they overheard the man calling gunman Michael Zihaf-Bibeau a martyr. That incident was also reported to police.

Police say man was 'very irate' when pulled over

Ottawa police pulled a black sedan over near the intersection of Bank Street and Heron Road at about 3 p.m. ET Saturday.

"He [the suspect] 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 suspect then tried to run through four lanes of traffic, police said. At that point, a police officer who wasn't in uniform appeared on the scene with a gun, according to witness Peter Dickson.

"[The suspect] 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."

Stun gun used to incapacitate man

McDade said two Ottawa police officers fired stun guns at the driver, the first one missing but the second one hit its target.

Ottawa police later said the gunshot came from an Ontario Provincial Police officer in plainclothes, who was monitoring the traffic stop. The gunshot was fired between the first and second stun gun attempt.

Bank Street was closed for more than four hours as police dogs and RCMP explosives disposal officers searched the sedan. Nothing was found.

The officer who was punched was taken to hospital with facial injuries. 

The suspect is charged with assaulting police, obstructing police, resisting arrest and driving while being suspended from doing so. His next court appearance is scheduled for Nov. 4.

According to courthouse documents, he is also facing more than $70,000 in parking tickets.