SALEM, Mass. (AP) — Police have made an arrest in the fatal shooting of an 18-year-old Salem State University student just days before what would have been his first college basketball game, an official said.

Missael Pena Canela, 18, of Salem, has been charged with murder in connection with the shooting early Wednesday of Carl-Hens Beliard, 18, according to Essex County District Attorney Paul Tucker.

Canela was arrested Wednesday evening by Salem police detectives and arraigned Thursday in Salem District Court. He pleaded not guilty.

Salem police said they received a 911 call at about 1:24 a.m. for a report of a shooting and found Beliard inside a vehicle suffering from gunshot wounds. He was taken to Salem Hospital, where he was pronounced dead.

Police said Wednesday that a preliminary investigation indicated the shooting didn’t appear to be random. Police said there also doesn’t appear to be any ongoing threat to the Salem State University community, adding that the investigation is “active and ongoing.”

The shooting came just hours after revelers had crowded the city for its annual Halloween celebration.

Assistant District Attorney Erin Bellavia said that Canela had an “on again, off again” relationship with a woman who was in the car with Beliard when he was shot. Bellavia said Beliard was struck by a single shot and crashed the car.

Canela’s attorney, Debra DeWitt, said she is reviewing his case.

“At this point in time, my client is innocent. I think there’s a lot of information we need to know,” DeWitt said Thursday.

Beliard is listed on the roster of the Salem State Vikings basketball team. The team’s first game of the season is scheduled for Wednesday, Nov. 8.

Beliard was also a member of Worcester’s North High School varsity boys basketball team and visited the Statehouse earlier this year to meet Gov. Maura Healey and Lt. Gov. Kim Driscoll after the team won the Division 1 State Championship. Healey and Driscoll both played basketball in college, Driscoll at Salem State.

Healey said her “heart aches for Carl’s family” and became emotional when asked Thursday about Beliard’s killing.

“We had the opportunity, both the lieutenant governor and I, to meet with Carl, who was the only senior on that state championship team, and his teammates. He was excited about going to college. He was excited about playing college ball,” said Healey, who said she phoned the team coach.

“I was just horrified when I heard the news that he had been killed, and killed in such a violent and senseless way, and killed at a time in his life when he should have every opportunity,” she added.

Salem Mayor Dominick Pangallo described the shooting as a terrible act of violence. He said “our hearts go out to the Beliard family and to the Salem State University community,” and he thanked investigators.

Salem State University President John Keenan called the shooting “heartbreaking for all in our community and every parent’s worst nightmare.”

In May, Worcester Mayor Joseph Petty honored members of the team for winning the Division 1 State Championship.