Montreal police are investigating after a 29-year-old man was fatally shot by a Surete du Quebec officer east of Montreal.

The SQ officer was sent to hospital after the shooting just before noon in the parking lot of a McDonald's restaurant in Sorel-Tracy, about 100 kilometres east of Montreal. He is being treated for shock.

The man was shot while police were trying to arrest him, said Montreal police officer Olivier Lapointe. He attacked officers by swinging a metal bar at them.

Police said he was wanted in connection with a violent crime that occurred several weeks ago. 

It's unclear at the moment how many times the man was shot.

"The suspect was (hit) at least once. His death was confirmed at the hospital. Of course, there's going to be a complete autopsy into how many times and where exactly he was (shot)," said Lapointe.

"I heard three shots but... I thought it was my dishwasher that wasn't working," said a nearby resident.

The Montreal police force has taken over the case, because under Quebec law, an outside police force is called in whenever a civilian is killed or injured during a police operation.

Police cordoned off a large perimeter around the McDonald's at 220 Victoria St. and surrounding businesses.

There were many witnesses in the altercation and they are currently being questioned, said Lapointe.

Police will also view surveillance footage caught on camera of the event.