NEW YORK -- A man accused of shooting a New York City police officer in the head will be arraigned Sunday on charges including two counts of attempted murder of a police officer, officials said.

The shooting instantly evoked fears of the December slayings of two uniformed officers as they sat in their patrol cars in Brooklyn by a man who posted online that he was seeking retribution against officers for the death of an unarmed black man in an apparent chokehold by police.

Demetrius Blackwell was arrested Saturday night in the shooting of Officer Brian Moore, who remained hospitalized in critical but stable condition.

Blackwell, 35, was expected to be arraigned Sunday afternoon, prosecutors said. It was not clear if he had a lawyer.

Moore, 25, was rushed to a hospital in a patrol car after he and his partner pulled up in an unmarked police car to a man who was adjusting his waistband suspiciously, police Commissioner William Bratton said.

The officers exchanged words with the man before he turned suddenly and fired at least twice, striking Moore, Bratton said. His partner, Officer Erik Jansen, radioed for help.

After the shooting, witnesses described Blackwell to responding officers and pointed them in the direction he ran, Bratton said. Officers searched house by house and some could be seen walking on roofs as helicopters flew overhead.

Police arrested Blackwell near the crime scene in a house on the block where he lives, officials said.

The December shootings of Officers Wenjian Liu and Rafael Ramos strained an already tense relationship between city police unions and Mayor Bill de Blasio. Patrolmen's Benevolent Association President Patrick Lynch turned his back on the mayor at a hospital the day of the killings and said de Blasio had "blood on his hands."

But Saturday night, Lynch was among the officials who attended the news conference and could be seen shaking the mayor's hand and speaking briefly with him afterward.

Bratton said Blackwell has a criminal record that includes a weapons possession charge, but the suspect made no such anti-police postings and was being pursued by the anti-crime officers because of his behaviour.

Associated Press writers Jake Pearson and Tom Hays contributed to this report.