BOSTON (AP) — The superintendent of the Massachusetts State Police abruptly announced his retirement on Friday amid accusations that he ordered a trooper to alter a police report for a judge’s daughter to avoid embarrassing them.

Col. Richard McKeon announced his retirement in an email to state troopers one day after Massachusetts Gov. Charlie Baker said he was investigating the allegations.

‘‘Part of our code of honor is understanding when your own personal ambition detracts from the greater good of our mission,’’ McKeon said in the message. ‘‘I have today decided that putting the greater good of the Massachusetts State Police first, necessitates my decision to retire after 35 years of proud service.’’


Trooper Ryan Sceviour said in a federal lawsuit filed this week that he was ordered to remove embarrassing information about the daughter of a judge who allegedly failed sobriety tests and indicated she was a heroin addict.

State police admitted the trooper was asked to alter the report and have defended the action, saying he included information that wasn’t relevant to her arrest.

McKeon said in a letter to Public Safety Secretary Daniel Bennett on Friday that he often instructed subordinates ‘‘to focus the arrest report on information relevant to charges made against the individual.’’

‘‘In every case, department members have been trained to exercise their power and authority judiciously and to treat offenders with courtesy and respect,’’ McKeon said.

A spokeswoman for Baker said the Republican governor appreciates McKeon’s service to the state police. Baker believes McKeon was wrong to get involved in the case of the judge’s daughter and has ordered the state police to examine procedures for reviewing arrest reports, she said.

‘‘Gov. Baker recognizes the motivation to protect those with substance use disorders from potentially embarrassing information contained in their public records and expects the courts to hold the defendant accountable for all charges stemming from this incident,’’ Lizzy Guyton said in a statement.