NEW BEDFORD — New Bedford police shot and killed a 15-year-old boy Thursday night after he repeatedly stabbed a member of the department’s gang unit with a hunting knife equipped with a gut hook, officials said.

The attack could have killed Officer Tyson Barnes, who is listed in stable condition at Rhode Island Hospital today, Mayor Jon Mitchell said at a press conference.

“Within an inch one way or another, he may not have been with us,’’ Mitchell said. “For some reason, the youth was carrying a hunting knife with a gutting hook and he saw fit to use it on a police officer. ... This is, by any definition, a tragedy for the city and highlights the dangers of police work.’’

Advertisement - Continue Reading Below

The teen was identified as 15-year-old Malcolm Gracia. Neighbors and a former teacher said today he had a history of behavioral problems linked to the death of his father.

Gracia was the son of Joseph M. Ramos Jr., who was shot to death by Dartmouth police on Aug. 11, 2009, according to Boston attorney Jeffrey Denner, co-counsel for Ramos’s family, which is suing the town and officers involved.

Denner said Ramos’s paternity of Gracia was never legally established, but he said that since Ramos’s death, one of Ramos’s siblings has been adamant that Gracia receive a portion of any recovery the family makes in its lawsuit.

Today, two friends of Gracia’s said the teenager never knew that Ramos was his father until after Ramos had been shot to death by police, a shooting that Bristol District Attorney C. Samuel Sutter concluded in March 2010 was a justified police use of deadly force.

Today, Sutter described the fatal encounter between Gracia and Barnes that played out in the Temple Landing housing development.

According to Sutter, Barnes and other members of the department's gang unit were at the development around 8:40 p.m. Thursday when they approached Gracia and another person.

Without provocation, Sutter said, Gracia pulled out the knife and repeatedly stabbed Barnes. Sutter said that other officers repeatedly ordered Gracia to stop stabbing Barnes and to get on the ground, commands the teen refused to follow.

Sutter said that the teen kept the knife in his hand. “While still armed, he began to move toward the other officers and after repeated instructions to stop, officers fired several shots at him,’’ Sutter said.

Gracia was pronounced dead at St. Luke’s Hospital here at 9:40 p.m.

Sutter, whose office is investigating the use of deadly force, refused to say if Barnes was wearing a bulletproof vest or specify where on his body the police officer was stabbed.

Gracia had attended the Whaling City Alternative School, where Nicholas Baptist taught him 7th-grade social studies last year.

Baptist, 31, said today that he and Gracia talked about the origins of Gracia’s behavioral issues, and that Gracia told him it was the sudden loss of his father in the police-involved incident.

“He was a very smart young man but had some problems in the school system,” said Baptist. “There were a few things he had problems with in the past. ... I just knew that his father had passed in some sort of altercation with police. He talked about that with me, and it was known to the staff at the school.”

Sutter refused to talk about the death of Gracia’s father.

In Temple Landing—a housing development that has undergone an $11 million transformation from a chronic source of crime and substandard housing into an attractive apartment complex—some residents talked about witnessing chaotic moments Thursday night.

Neighbors said they heard four to eight shots and then saw the officer lying on the ground as Gracia grabbed his chest and then collapsed onto the ground. The officer writhed in pain, but Gracia, they said, did not move seconds after he fell down. The two lay about 30 feet apart, witnesses said.

None of those interviewed witnessed the confrontation that led to the fatal incident, but one woman said she looked out her window and saw Gracia run by, followed by several police officers. Moments later, gunshots rang out.

Witnesses said police provided emergency medical aid to both Gracia and the officer until paramedics arrived on the scene.

Baptist, the teacher, said Gracia was an intelligent teen.

“He was a very thoughtful young man and very smart. We used to write songs together, about changing the world in a positive way,’’ Baptist said. “He just had a little bit of confusion that if he had a chance to work through, he would have been a very positive part of the culture in New Bedford. He was a kid that was looking for something, but for whatever reason, he never found it.”