Allen Scarsella Hennepin County Sheriff's Office

Allen Scarsella testified Monday that he shot at five to seven men after one of them came at him with what appeared to be a knife as he stood watching people protest the police shooting of Jamar Clark.

The 24-year-old Bloomington man is charged with shooting and injuring five protesters the night of Nov. 23, 2015 near the 4th Precinct police station in north Minneapolis. Prosecutors say they believe Scarsella was motivated to shoot the five men, all African-American, out of racial bias.

Assistant Hennepin County Attorney Judith Hawley on Monday pointed to text messages from Scarsella's phone in which he allegedly talked about "shooting black guys."

Later, Scarsella acknowledged he wrote a February 2015 text saying, "It's cool the gun I'm getting has been proven to kill black guys in a single shot." He also admitted in court that he wrote text messages calling black people "chimps" but said he shot the African-American men that night because he feared for his life.

Testifying in his own defense, Scarsella said the group of protesters were shouting threats at him as he walked away from the larger demonstration outside the 4th Precinct station. Some protesters, he added, had accused him and three other men who were with him of being with the Ku Klux Klan.

He said a protester had already punched him in the face and he said he was afraid the men intended to try and hurt him some more, so he fired in self-defense, adding that he couldn't remember how many shots he fired and that it felt like he was "in shock" following the shooting.

Scarsella said he fired first at a man holding what he thought was a knife. However, there's been no evidence presented so far of there being a knife and only defense witnesses — Scarsella and Nathan Gustavsson, his companion that night — have said they saw a weapon.

Scarsella, in a surprise twist, agreed to take the stand in his own defense. He began on Friday with mostly personal details of his life before the shooting, including that he was an Eagle Scout and had attended West Point military academy.

West Point confirmed that he attended from June 28, 2010 to June 6, 2012. Records show he resigned.

Scarsella told the court he left West Point after an investigation was opened against him, and that he also left for "other reasons."

Hawley, the prosecutor, countered with the fact that Scarsella was kicked out of West Point because of misconduct involving a pellet gun.

At one point during the Monday afternoon testimony, Hawley stopped while reading a text message with the n-word in it. She said she had a hard time saying the word n-word refers to.

She asked Scarsella if he liked saying it. He said no. She asked if he had a problem writing it in texts. He said no.

Scarsella's defense attorney asked him if he hated black people. Scarsella answered no.

His attorney then asked him if it surprised him when his girlfriend said he hated black people. Scarsella responded yes, it did.

Overall, Scarsella said that none of his derogatory texts were meant to be taken seriously.

Those messages were often shared with his childhood friend Brett Levin, who at the time of the shooting was an officer with the Mankato, Minn., police department. Levin left his current job with the Burnsville police department after he admitted under oath at trial that he shared some of the those offensive texts with Scarsella.

Scarsella said his comments were grounded in ignorance about people of color, not hatred.

At a couple points in Scarsella's testimony, a few women in the gallery of spectators got up to leave. One was in tears.

Judge Hilary Caligiuri has made multiple admonishments to observers to refrain from reacting audibly or visibly during testimony. She made those pleas frequently during Scarsella's time on the witness stand.