A man who attacked Rep. Angie Craig (D-Minn.) in her apartment building earlier this year was sentenced Thursday to 27 months in prison after pleading guilty.

Kendrid Khalil Hamlin, 27, followed the Minnesota congresswoman into an elevator in her apartment building Feb. 9, according to court documents. He told her he planned to use her restroom, and when she declined, he punched her in the face and tried to stop her from reaching the elevator key pad. Craig threw a cup of hot coffee on Hamlin, after which he let her go and she ran from the elevator.

Craig sustained injuries including an abrasion on her lip, bruising and pain around where Hamlin hit her. In a victim impact statement filed with the court earlier this week, the Democratic lawmaker said her mental and emotional recovery is ongoing.

“While this case has received much attention because I am a Member of Congress, that morning I was simply a woman followed into an elevator by a man and assaulted there,” Craig wrote.

Craig continued that her sense of safety and security has been “significantly impacted,” causing her to seek professional help to address anxiety and self-defense training.

“I sincerely hope Mr. Hamlin, during his incarceration and subsequent conditions of release, is provided the mental health and addiction services that will allow him to become a productive member of society,” Craig wrote. “Until that occurs, given his history of previous convictions and my own experience, I believe he would continue to be a further threat to others.”

During his sentencing Thursday, Hamlin apologized to Craig and said he intends to seek schizophrenia and substance abuse treatment, according to The Associated Press.

“I really do apologize to Angie Craig for putting my hands on her, and also the officers,” he said.

Hamlin’s parents also addressed the court, calling the attack “horrifying” and describing unsuccessful efforts to get Hamlin effective treatment for more than a decade.

Hamlin pleaded guilty in June to assaulting Craig and law enforcement officers who later confronted him. U.S. District Judge James Boasberg addressed Hamlin’s mental health issues and said he would recommend the sentence be served in a Bureau of Prisons medical facility, The Associated Press reported.