A suspect who barricaded himself in a home in Richmond Hill after he allegedly opened fire at a police officer at a gas station Friday morning has been taken into custody, ending a nearly 12-hour long standoff, York Regional Police say.

Gunfire rang out Friday morning at a Petro Canada station near the southwest corner of Bayview Avenue and Major Mackenzie Drive.

Witnesses in the area said they heard multiple shots fired. Images from the scene showed a Sleep Country van with the driver’s side window shattered and a black jeep that appeared to have been rammed on one side.

According to York Regional Police, an officer pulled over a vehicle for a traffic stop at the gas station at around 10:30 a.m. when the suspect opened fire on the officer. The officer returned fire and the suspect fled at a high rate of speed, police said.

A short time later police said they had a suspect “contained” at a nearby house. The suspect is considered armed and dangerous, police said.

A number of nearby homes have been evacuated as a precaution and it’s not clear how long the standoff will last.

"We don't know what's going through the mind of the suspect," YRP Const. Laura Nicolle told reporters in a scrum Friday afternoon.

She said “significant resources” have been deployed to deal with the situation, including a negotiator and K9 units.

Members of the Toronto Police Emergency Task Force equipped with armoured vehicles and automatic rifles are also on-scene assisting with the situation, a Toronto police spokesperson said.

It is not believed that there are any other people inside the home with the suspect.

Just before 10:30 p.m., York Regional Police said in a tweet that the suspect has been taken into custody. There is no word if the man has been injured.

Party is in custody & situation has ended.

It is safe for residents to leave shelter area.

Call takers will be calling you back to confirm

thank you for assistance

LD https://t.co/abw3uW2zTN — YRP Duty Office (@YRPDutyOffice) December 28, 2019 Residents should expect a large police presence to remain in the area as the investigation continues, police said. Images sent to CP24 from the scene shortly before noon appeared to show gas wafting outside an area home, with multiple police vehicles on scene.

York Regional Paramedic Services said one special response unit and one transport unit were called to the gas station at around 10:44 a.m. Two patients were assessed but nobody was transported to hospital, a York paramedic spokesperson said.

Nicolle said it is not believed that any bystanders were struck by gunfire, but she called the incident “dangerous and concerning.”

"It is quite shocking that someone would pull out a firearm and begin shooting in a busy crowded area in the middle of the day," Nicolle said.

The province's Special Investigations Unit said Friday afternoon that it was investigating the possibility that the suspect may have been struck by gunfire during the incident.

If so, the watchdog would invoke its mandate. Police said several times they had no evidence to support the notion that anyone was injured in the encounter.

One witness named Seth who works at a nearby store told CP24 he came out to see what was going on when he heard the gunfire.

“I was on the phone with my co-worker. I heard four or five consecutive loud bangs. I came outside to see what was happening and I see a black police SUV parked in front of the store. The officer was holding an assault rifle,” he said.

“Then I see a greenish-beige-ish SUV come speeding out of the Petro Canada gas station on the southwest corner of Major Mac and Bayview and he just speeds out going westbound and the police officer runs back to his car. I see a bunch of other police officers pull up and turn around and they all start following him westbound.”

Several other people who heard the shots as they shopped nearby said they were shocked.

“We were at Food Basics and we just heard like a lot of shots,” Camilia Hertz said.

Another man said he came over to the gas station after he heard gunfire.

“I heard the shots coming – at first it was pop pop pop pop – then a little bit of a delay,” Shayan Naderian told CTV News Toronto. “There was like one more shot. I wasn’t sure if it was a shot, but I heard a lot of cop cars coming this way.”

He said it’s scary to hear gunfire in his normally quiet neighbourhood.

“To be really honest, this is very scary – we live just one street down and this is Richmond Hill, you know,” he said.

Yellow police tape cordoned off the gas station and multiple police vehicles are at the scene.

Bayview Avenue currently closed in both directions at Major Mackenzie Drive as police investigate.