After the release of a video showing a police officer shoot 17-year-old Laquan McDonald in 2014, angry Chicagoans protested for much of the night. (Gillian Brockell/The Washington Post)

In a surprising move, the prosecutor who announced murder charges against the Chicago police officer who fatally shot Laquan McDonald said Thursday that she would withdraw from the case.

Cook County State’s Attorney Anita Alvarez, who lost her reelection bid earlier this year in the Democratic primary, said she was asking the court to appoint a special prosecutor in her place.

“While it is has not been an easy decision, I believe that it is the right one because it will help to avoid unnecessary legal delays and provide continuity in the handling of this very important and complicated case,” Alvarez said in a statement. “It would also ensure that one designated prosecutor will handle this case as it proceeds to trial.”

Earlier this year, activists and civil rights attorneys called for a special prosecutor to replace Alvarez because they said she was too closely tied to the city’s police. Alvarez, though, has defended the way her office handled the case, telling Chicago Magazine earlier this year that she would “not apologize for the meticulous, thorough investigation we did.”

On Thursday, Alvarez said there was “no legal conflict of interest” that would stop her office from prosecuting the case, but that she felt it was responsible to turn things to a special prosecutor given her recent electoral loss and the reality that a new prosecutor will replace her.

In a court filing responding to petitions calling for a special prosecutor, Alvarez pushed back against the argument that she was too close to the police department and the police union. But she wrote that her primary goal “is, and has always been, to obtain justice for Laquan McDonald” as well as making sure there was continuity in the case.

FILE - In this Nov. 24, 2015, file photo, Cook County State's Attorney Anita Alvarez talks to reporters in Chicago after the bond hearing for Chicago police Officer Jason Van Dyke, on murder charges in the killing of 17-year-old Laquan McDonald. In her re-election bid, Alvarez faces Kim Foxx, a former chief aide to the county board president and former prosecutor Donna More in the Democratic primary on March 15, 2016. (AP Photo/Charles Rex Arbogast, File) Cook County State’s Attorney Anita Alvarez. (Charles Rex Arbogast/AP)

Alvarez had been heavily criticized over her decision to wait more than a year to announce murder charges against Jason Van Dyke, the Chicago officer who fired 16 bullets in McDonald in October 2014.

Video footage of the shooting was released last November, going public on the same day Alvarez announced that Van Dyke would be charged. It set off a firestorm, prompting a federal investigation, extensive protests and the resignation of Police Superintendent Garry McCarthy.

The fallout from the video’s release continued into this year, as the McDonald video and the delayed charges were sizable issues in Alvarez’s unsuccessful campaign for a third term.

In addition, the Chicago Police Department remains under a bright microscope since the video was released, as a task force assembled by Mayor Rahm Emanuel (D) assailed the force recently for what it described as a miserable legacy of behavior toward minorities. The city is also facing a staggering rise in gun violence and killings so far this year.

City officials have already announced changes to the police force in an effort to make some reforms, but a Justice Department investigation may wind up bringing about even more changes.

Van Dyke has been released on bond since November. On Thursday, a judge said that a group had worked out a security plan so that Van Dyke could safely appear in court.

Further reading:

After a blistering report, what’s next for the Chicago police?

An activist community has taken on a high profile in Chicago

Alvarez said they would not file charges in another shooting that occurred before McDonald’s