HALIFAX -- A man wanted in connection with a shooting outside a New Brunswick school was arrested without incident in Amherst, N.S., on Wednesday.

The RCMP in both provinces confirmed 24-year-old Janson Bryan Baker has been taken into custody.

The takedown was swift as a number of officers quickly converged on an apartment building on Eddy Street.

"I’m glad they got them when they did because God knows what he would have done," said Amherst resident Darren Murray.

Police were alerted to Baker’s possible location by employees at a collision repair centre.

They were doing their usual car count and discovered there was one more than there should be in their parking lot and it fit the description of the vehicle Baker was driving so they called police.

"They came and checked it out and they told us not to go on social media or say anything about what was going on," said Ryan Beattie, an auto body shop employee.

Police moved in a short time later.

"We were all in our offices and we heard some yelling and screaming," said Andrew Gilroy.

Gilroy says he and the rest of the staff at a nearby real estate office all moved to the far end of the building to put as much distance between them and what was going on just outside their door.

"We read the alerts that he might be armed so we just figured cover was the best idea instead of watching," Gilroy said.

The Nova Scotia RCMP first confirmed the arrest in a tweet at 12:01 p.m. Wednesday -- just 20 minutes after an emergency alert was issued in Nova Scotia.

The arrest came after a roughly 19-hour manhunt for Baker, who was wanted in connection with a shooting outside Riverview High School in Riverview, N.B.

Police said Baker’s vehicle was found across the border in Amherst shortly after 8 a.m. Wednesday, but the suspect, who they believed to be armed, was still at large.

The Amherst Police Department confirmed local officers found the abandoned vehicle and said there was no immediate threat -- though Baker was nowhere to be found.

Amherst is located roughly 70 kilometres southeast of Moncton and is close to the New Brunswick border.

SEARCH FOR SUSPECT AFTER TEACHER INJURED IN SHOOTING

Police responded to the shooting outside Riverview High School around 5:15 p.m. Tuesday. A 35-year-old man was taken to hospital with non-life-threatening injuries.

CTV News has learned the injured person is a teacher who also coaches the boys’ basketball team. He was leaving the school after a practice around 5:15 p.m. Tuesday when he was confronted and shot by a man who tried to rob him.

An emergency alert was issued in the Greater Moncton area Tuesday evening, advising residents that police were searching for an armed man in connection with the shooting.

Police said Baker was believed to be carrying firearms “with intent to use them.” They later confirmed that the firearm used in the shooting was not a BB gun, but declined to say exactly what type of weapon was used.

Police said Baker may be driving a black 2020 Hyundai Elantra with black tinted windows and New Brunswick licence plate JUN 296.

Police continued to provide updates on social media overnight and Wednesday morning, confirming that the search for Baker was ongoing. 

They said residents in the Greater Moncton area and southeastern New Brunswick could “proceed with their usual activities but to exercise caution and increased vigilance.”

In addition, police say a 33-year-old Riverview man was questioned in connection with the incident, but was later released.

SCHOOLS CLOSED AS A PRECAUTION

All schools in New Brunswick’s Anglophone East School District were closed Wednesday as a precaution.

In the Francophone South School District, schools in Moncton and Dieppe were also closed. 

In a note to families, Jason Reath, the principal of Riverview High School, confirmed there was a “serious incident” on the property -- after students had been dismissed for the day Tuesday -- and that someone had been injured.

Reath said Riverview High School is working with the RCMP and will provide support to students who need it.