A New York City police officer from Long Island was shot in the head in Queens Saturday night and surgeons were fighting to save his life, officials said.

Officer Brian Moore, 25, of Massapequa, was in plainclothes and in an unmarked police car with his partner in Queens Village when a man they sought to question pulled out a gun and shot him, Police Commissioner William Bratton said.

Demetrius Blackwell, 35, identified as the suspected shooter, was under arrest after a manhunt by scores of NYPD and Nassau County officers.

See alsoSee a map of the shooting

Moore underwent hours of surgery at Jamaica Hospital Medical Center. Doctors said it would take 24 to 48 hours before they knew his prognosis.

Police in massive numbers descended on the neighborhood after the 6:15 p.m. shooting. Officers peered into yards and passing vehicles and told residents to stay in their homes.

Moore, an anti-crime officer with the 105th Precinct, was shot at 104th Road and 212th Street.

advertisement | advertise on newsday

The gunman pulled a weapon during an encounter with plainclothes police and started shooting without warning, another police source said.

Moore and Officer Erik Jansen, 30, were in an unmarked car and saw the suspect "walking and adjusting an object in his waistband," Bratton said at a news conference at the hospital.

They followed him in the car and started to talk to the suspect, who "immediately removed a firearm from his waistband and turned in the direction of the officers and deliberately fired several times into the vehicle, striking Officer Moore in the head," Bratton said.

Get the Newsday Now newsletter!

The best of Newsday every day in your inbox.

A father and daughter who live down the block from the scene of the shooting said they heard about three gunshots and went outside, where they saw a man they believed to be the shooter fleeing.

He emerged from the backyard of a home at the southeast corner of 212th Street and 104th Road and jumped over a fence before heading east, said the father and daughter, who declined to give their names because they feared retribution.

"The pants were too low, he couldn't run with them," said the father, who has lived at the house 10 years. "He was walking fast, he was pushing the gun down into his pants."

The daughter said that when police arrived about five minutes later, she and her dad directed them in the direction they saw the man flee.

Deborah Caviness, who lives on 212th Street, said she was in her backyard with her grandchildren when she heard gunshots.

advertisement | advertise on newsday

"I heard three shots," said Caviness, who has lived in her Queens Village home for 30 years. She said shootings in the neighborhood are rare. "It's terrible," she said.

However, one of the police sources said drugs and gang activity are problems in the neighborhood.

The shooting comes five months after two NYPD officers were shot and killed in Brooklyn. Officers Wenjian Liu and Rafael Ramos were shot execution-style by Ismaaiyl Brinsley in the wake of a grand jury's decision not to indict a police officer in the death of Eric Garner. Brinsley shot himself to death minutes later.

Bratton said there was no immediate indication of a similar motive in last night's shooting.

Moore joined the force in July 2010. His father and uncle are retired NYPD sergeants and he also has a cousin on the force, Bratton said.