A man pleaded guilty on Tuesday to shooting a Minneapolis police officer earlier this year, as part of a plea bargain that will send him to prison for more than 13 years.

Andrew Neal, 43, of Crystal, pleaded guilty to two felony counts – first-degree assault on a peace officer and burglary – in connection with the shooting of officer Jordan Davis, who was shot in the shoulder after responding to a domestic violence call. Davis said he expected to return to his job in several weeks.

A few hours before his trial was to begin Tuesday, Neal entered into a plea agreement with prosecutors that calls for him to serve 161 months in prison for the assault charge, to run concurrently with a 111-month sentence for the burglary charge. Under the deal, Neal, a former police informant with a lengthy criminal history, will have to serve at least two thirds of the sentence, authorities said.

Prosecutors said that on Feb. 21, the defendant shot Davis with a 9-millimeter handgun as he walked back to his squad car outside an apartment building in the Jordan neighborhood, although Neal’s attorney questioned whether his client knew he was targeting a police officer.

The incident, which came amid a rash of shootings nationwide of police officers, sparked an eight-hour manhunt that extended across the city. When he was taken into custody, prosecutors said Neal thanked the arresting officers for not shooting him.

On Tuesday afternoon, the 11th-floor courtroom was crammed with more than 60 police officers – “I don’t think we need those guys today, ”one attorney quipped, as a bailiff walked past – in a show of support for Davis, who sat in the front row with his family. Several feet away, two members of Neal’s family sobbed softly as the sentence was read.

During his victim impact statement, Davis called Neal a “drain on society” and said he and his fellow officers were there “to celebrate your absence from society.”

“Congratulations on going back to prison, where you belong,” he continued. “We’ll be waiting for you to slip up again and pull you right back where you belong, right back in prison.”

Neal gave mostly one-word answers to the judge's questions, but when given an opportunity to speak before being sentenced he apologized to Davis and his family.

Prosecutors dropped a domestic assault charge after Neal's former girlfriend stopped cooperating with authorities, according to a source with knowledge of the investigation.