A plainclothes police officer has been seriously wounded after being shot in the head in New York.

Police officer Brian Moore, 25, was shot while inside his car in the city, Police Commissioner Bill Bratton said during a press conference.

The officer had surgery after being admitted to hospital and was said to be in a critical condition.

According to Commissioner Bratton, two officers were in an unmarked car when they saw a man adjust something on his belt and they then approached him.

The man fired immediately, the police commissioner said, while the two officers were still in the car.

The alleged shooter was arrested just over an hour later.

This is the fifth shooting of an officer in New York in five months.

New York Mayor Bill de Blasio said the police officer was "very, very seriously injured".

"It's a reminder of the dangers all of our officers face every single day," Mr de Blasio told a news conference at the hospital.

The shooting comes at a time of increased national focus both on the use of force by law enforcement officers and the dangers of police work.

On Friday, six officers were charged in the death of a Baltimore man who was injured while in police custody.

Mr de Blasio's relations with New York City police fell sharply after two city officers were shot and killed in December as they sat in their patrol car, in what officials said was a targeted attack.

Hundreds of officers turned their backs when the mayor delivered a eulogy at one of the officer's funerals, angry at what they saw as his failure to support them during a wave of anti-police protests in the city late last year.