MINNEAPOLIS (AP) - A Burnsville police officer has resigned after testifying he exchanged "racially charged" messages with a man on trial for allegedly shooting at Black Lives Matter protesters.

Officer Brett Levin testified Tuesday at the trial of 24-year-old Allen Scarsella. Scarsella is accused of wounding five black men protesting the shooting death of Jamar Clark in November 2015.

Levin was a Mankato police officer at the time and a friend of Scarsella. Levin testified he urged Scarsella to turn himself in when Scarsella called him.

Levin also testified he frequently received "racially charged" emails from Scarsella that were "negative about black people." He said he replied to Scarsella with similar texts.

Burnsville Police Chief Eric Gieseke says Levin has resigned. A home telephone number for Levin could not be found.