The city’s top cop slammed a lawsuit brought against Boston Public Schools for sharing student information with federal immigration officials, saying administrators have that right — especially if it’s naming suspected MS-13 members.

“People have been critical of the Boston Public Schools for giving us information,” police Commissioner William B. Evans said on Boston Herald Radio’s “Morning Meeting” show yesterday.

“This is all about keeping those schools safe. And if someone is mentioned as an MS-13 … member, then the schools should let us know because we had five murders because of that,” Evans added. “To say that they shouldn’t notify law enforcement, our job is to keep those kids safe so they go home to their parents.”

Evans made his comments while speaking about a lawsuit against Superintendent Tommy Chang and Boston Public Schools for information on what it claims is the district’s “disturbing practice” of sharing student information with federal immigration officials.

The information exchange has become a “school-to-deportation pipeline,” the suit claims. Lawyers say an East Boston High School student was deported after a report was shared by Boston School Police with ICE through the Boston Regional Intelligence Center, known as BRIC.

Authorities have linked MS-13 to the brutal slayings of five teens in 15 months, whose bodies were found in East Boston beginning in September 2015.

The lawsuit, filed by Boston law firm Morgan, Lewis & Bockius, is seeking to find out how often BPS shares student information with federal authorities.

The suit, and Evans’ reacton to it, comes as federal and city police crack down on the brutal MS-13 gang.

Federal authorities indicted 56 MS-13 gang members two years ago on multiple charges including racketeering and accused some of murder along with drug and gun charges. The case is the largest MS-13 national case to date, which now has more than 60 alleged gang members indicted.

Christina Sterling, spokeswoman for the U.S. Attorney’s Office in Boston, said her office is 49 for 49 in convictions, including 16 who have been prosecuted for murder.

Mayor Martin J. Walsh yesterday defended the school’s practice, saying officials only share information with police and federal authorities on the most serious crimes.

“If it’s a misdemeanor or something smaller, we’re not going to be contacting the federal government,” Walsh said. “The Boston Public Schools does not share information on the status of immigration for children, we don’t do that. If the Boston Police Department has to do an investigation, we don’t share information either with ICE, unless it is a serious offense.”

Evans said just because a student is accused of being a gang member, does not automatically mean they’ll be designated that by police. That determination is made by the department’s gang unit, Youth Violence Strike Force, which has strict criteria for determining who runs with a gang.