Boston police officers are responsible for the murder of a young woman who was beaten to death by a man she had a restraining order against, according to a federal lawsuit claiming that cops failed to arrest the alleged killer when he violated the order two days before the crime.

Stephanie McMahon was found beaten to death in the early morning hours of Nov. 18, 2014, according to court documents. Randall Tremblay, an ex-boyfriend whom she had an active restraining order against, later told police: “She’s dead because of me,” according to authorities.

Tremblay admitted that he struck McMahon in the head 12 to 15 times, that “she got it good,” and that “I think I killed her,” according to court documents.

Two days earlier, officers Robert Boyle and William Hubbard went to McMahon’s home after she called 911 — telling a dispatcher that Tremblay was trying to hit her “over the head with a stick” and that she had restraining order against him, according to the lawsuit against Boston.

However, the officers did not check to determine whether there was an active restraining order, court documents show. Instead of arresting Tremblay when they met him in McMahon’s hallway, they took him to the Shattuck Hospital and left him outside, according to the suit.

“Officers Boyle and Hubbard did not take reasonable steps to determine whether Ms. McMahon had a restraining order against the man in the hallway, and by failing to take these reasonable steps, affirmatively increased the threat of harm to the decedent, and emboldened Mr. Randall Tremblay to return to the decedent’s apartment to kill her,” attorney Danilo Avilon wrote in his lawsuit against the city.

Marilyn Barresi, McMahon’s mother, filed a lawsuit against the city of Boston in Suffolk Superior Court last week, and on Tuesday it was moved to federal court.

Boyle and Hubbard were subject to an internal investigation after the incident, according to a BPD spokesman. Charges were sustained, both served suspensions and both officers are currently back on active duty, the spokesman said.

BPD declined to comment on the allegations made in the suit, citing the ongoing litigation.

Tremblay, meanwhile, has not yet gone to trial for McMahon’s murder. A Superior Court judge ruled that his statements to police should be tossed because he was too drunk to waive his Miranda rights. Last fall the Appeals Court overturned that decision.

The Supreme Judicial Court has agreed to hear the case concerning his statements to police.

“This has weighed heavily on her mother and her brother,” Avilon said. “They feel that justice has been delayed, and they cannot seem to get any closure on this matter.”