A white bicyclist who attacked a black motorist in Georgetown last year following a dispute with the driver was sentenced Tuesday to three years in prison.

Maxim Smith, 25, was convicted of assault with a dangerous weapon and felony assault while armed for beating the driver in his head and hands with what prosecutors said was a metal bicycle U-lock. Prosecutors had argued the assault was a hate crime because Smith had repeatedly called the driver the n-word, but the D.C. Superior Court jury that heard the case was unable to reach a unanimous verdict about whether the attack was fueled by racial bias.

Still, at Tuesday’s hearing, prosecutors asked Judge Kimberley Knowles to sentence Smith to a tougher punishment — four years in prison — allowed under a hate crime enhancement.

“This crime was motivated by hate and bias and should have no place in the District of Columbia or anywhere in this country for that matter,” Assistant U.S. Attorney Jack Korba said.

Justin Okezie, an attorney for Smith, said his client is not racist. He said Smith was under the influence of alcohol and cocaine on the night of the incident and requested he be allowed to attend drug and alcohol counseling instead of jail.

Smith offered his regrets. “I apologize for my actions. I wasn’t myself at the time. I should not have been on the road,” he said.

During his trial, Smith admitted he struck the driver, Ketchazo Paho, but said he feared for his safety because Paho had gotten out of his car and grabbed the bicycle.

Originally from Ukraine, Smith was adopted by a Washington couple when he was 13. He testified he had learned the n-word through rap music and growing up in Washington. Smith testified that he used the derogatory term to “emotionally hurt” Paho because he thought Paho had tried to strike him with his car.

Their confrontation unfolded in the overnight hours last August as Smith was biking in the right-turn lane of the 3100 block of M Street NW ahead of a frustrated Paho, 35, who began honking his horn.

As Paho passed Smith, police said, Smith reached out and hit his car trunk. Paho said he stopped his car, began to call 911 and grabbed Smith’s bike to detain him as Smith tried to pedal away.

It was then, prosecutors said, that Smith repeatedly used the racial slur and hit Paho in the head. Paho’s wound required 21 stitches.

Paho did not attend the sentencing, but a prosecutor read a letter by Paho in which he wrote that, in addition to the physical scars, he suffers from post-traumatic stress for which he takes medication.

Smith’s mother and two friends spoke on Smith’s behalf. They each said Smith had never shown hate or racial animosity. One of the friends, a black man who declined to give his name outside the courtroom, told the judge that he and Smith were best friends for 10 years and that all of Smith’s friends were African American. “He doesn’t have any white friends,” the man said in court.

Knowles rejected the prosecution’s request to impose a harsher punishment based on racial bias, saying she believed Smith’s drug and alcohol impairment while bicycling fueled the attack. But she also encouraged Smith to stop using the n-word.

“I don’t know if you used the word out of hate or you used it casually because you have friends of color and you and your friends use it among yourselves,” Knowles said, “but as a Caucasian male, you have to know walking up to a stranger and using it isn’t going to end well. I suggest you eliminate that word from your vocabulary.”

In October, Smith has another trial in connection to a misdemeanor destruction of property case involving a black Lyft driver late last year. Smith was charged with damaging the window of the Lyft driver’s car while swerving his bicycle erratically, striking the car’s window. He also allegedly called the driver the n-word.

An earlier version of this story incorrectly said the confrontation began in the center lane. It started in the right-turn lane.