The man who attacked U.S. Rep. Angie Craig in the elevator of her Washington, D.C, apartment building in February received a sentence of more than two years in prison Thursday from a U.S. District Court judge.

Prosecutors sought more than three years because of Kendrid Khalil Hamlin's history of violence and legal problems. In a memo filed Thursday, defense attorneys asked for a sentence of one year and one day followed by treatment and supervised release.

Chief Judge James Boasbergsentenced Hamlin to 27 months in prison followed by three years of supervised release and treatment, records show.

In court, Hamlin said he's "deeply remorseful for the harm he caused Representative Craig and continues to pray for her healing," his lawyers said.

Hamlin pleaded guilty earlier this year to one count of assaulting a member of Congress on Feb. 9 and two counts of assaulting law enforcement. There's no evidence the attack was politically motivated.

According to court documents, Hamlin went into the lobby of Craig's apartment building to warm up. When she arrived with her morning coffee, he followed her into the elevator and assaulted her. She was able to escape by throwing hot coffee on him.

In a victim impact statement filed Tuesday with the court, Craig said she and her family were shaken by the attack, that she was forced to break her lease and move because of the political attacks and media attention that followed.

"While my physical recovery was days, my mental and emotional recovery has taken much longer and is ongoing," she wrote. "My sense of safety and security has been significantly impacted."

Craig is a Democrat in her third term representing the Second Congressional District south of the Twin Cities. The swing district is highly competitive.

In requesting mercy for Hamlin, defense attorneys Kathryn Guevara and Eugene Ohm wrote about his severe mental health problems. The lawyers said a one-year sentence would be "fair and reasonable given Mr. Hamlin's documented history of mental illness, extensive trauma, and substance abuse issues."

The defense attorneys also requested the judge order Hamlin to receive inpatient substance abuse treatment followed by mental health treatment. Since he was a child, Hamlin struggled with learning disabilities and mental illness that led to addiction and homelessness, the lawyers said. After he aged out of Family Court, he was unable to receive consistent treatment, the memo said.

When he was arrested for attacking Craig, he was off his medication, living in the streets and struggling acutely with addiction, the memo said. As a homeless man in D.C., he's suffered numerous assaults and stabbings, been hit by a car and a Metro train.

His attorneys said that Hamlin is "extremely remorseful for assaulting Congresswoman Craig, not because of her office, but because she was an innocent woman who meant him no harm."

Hamlin went into Craig's building to get out of the cold, the lawyers wrote. When Craig greeted him and showed him kindness, he asked to go use her bathroom, hoping he could wash up, the memo said. But instead he terrified her and then interpreted her fear as aggression.

"He very much regrets that he scuffled with her and struck her, and immediately instructed counsel he wanted to plead guilty regardless of the government's offer," the memo said.

His lawyers wrote that Hamlin has been stable for the past nine months, "unfailingly warm, charismatic, and genuinely committed to change."

The defense attorneys said they're disappointed in the length of the prison sentence, but hopeful that Hamlin will finally get the mental health treatment he has sought and needs.

"Like Representative Craig, the judge acknowledged the societal failures in helping the mentally ill and homeless," the lawyers wrote after sentencing. "We hope that the nation will work towards a solution for our mentally ill community members and stop the ineffective and deeply harmful practice of incarceration as a substitute."