The NYPD officer who was shot in the head while sitting in an unmarked patrol car in Queens over the weekend has died and charges against the suspect in his slaying have been upgraded to first-degree murder.

Officer Brian Moore, 25, died Monday afternoon after being taken off life support at Jamaica Hospital two days after the shooting in Queens Village. Moore had been put in a medically induced coma and had surgeries for "severe injuries to his skull and brain."

The son of a cop from a family with deep NYPD ties, Moore proved himself an exceptional officer since joining the force in 2010, making 150 arrests and winning four medals for his police work, Police Commissioner Bill Bratton said.

"It's a great loss to his family, a great loss to the department and a great loss to his profession and his city," Bratton said.

The commissioner said it was a particularly rough day for the officers in Moore's precinct, the 105th, because they had just returned that morning from the funeral of another officer who died suddenly from an illness that may be related to 9/11.

After Bratton delivered the grim news, an NYPD honor guard assembled as Moore's remains were taken from the hospital.

At evening press conference, Mayor Bill de Blasio said New Yorkers "have to be thankful that there was a hero amongst us by the name of Brian Moore."

"Our hearts are with the Moore family," de Blasio said. "This is a family that has done so much for the rest of us."

De Blasio has ordered all flags on city buildings and on stationary flagstaffs throughout the five boroughs lowered to half-staff until the day of Moore's burial.

President Obama, in town to announce the launch of new foundation to help young minority men, commented on Moore's service and slaying.

"He came from a family of police officers and the family of fellow officers he joined in the NYPD and across the country deserve our gratitude and our prayers, not just today, but every day," Obama said. "They’ve got a tough job."

Demetrius Blackwell of Queens was arrested at his home about 90 minutes after the shooting. He didn't enter a plea on that charge Sunday and is being held without bail.

Since Moore's death, the charges against Blackwell have been upgraded to include first-degree murder which carries a penalty of life in prison without parole.

A 5-shot revolver with three spent rounds and two live rounds has been recovered from a yard near where the suspect lived and authorities are testing to the weapon to see if it matches the gun that shot Moore, NYPD Chief of Detectives Robert Boyce said. The gun was among 23 stolen in 2011 from a bait and tackle shop in Georgia, Boyce said. Nine of those guns made their to way to New York City, Boyce said.

Moore and patrol partner Erik Jansen -- both in plainclothes in an unmarked police car -- approached a man later identified as Blackwell on a Queens street after seeing him tugging at his waistband around 6:15 p.m. Saturday and asked him "What are you carrying?," prosecutors said.

The officers ordered Blackwell to stop and exchanged words with him. That's when Blackwell allegedly turned, the prosecutor said, and "in a vicious manner started to fire" -- at least two shots. One bullet hit Moore in the head; Jansen wasn’t hit and radioed for help.

The suspect was identified by Jansen and two eyewitnesses who saw him fleeing the scene, Boyce said. Witness description of a silver handgun matched the gun recovered, Boyce said.

Prosecutors said that Blackwell told a detective that he is known in the area as a "hellraiser on the street." He was arrested in his home after a search.

Blackwell's court-appointed lawyer, David Bart, said his client denied the charges, which also include assault and weapons offenses.

The shooting comes less than six months after two NYPD officers were executed as they sat in a patrol car in Brooklyn. The killings touched off a period of high tension between City Hall and the NYPD as police union officials publicly blamed the mayor for allowing what they perceived as anti-police sentiment to flourish in the city, especially with the Eric Garner protests.

Traces of the old tension resurfaced Monday at a news conference when a reporter asked the mayor why he wasn't at the hospital when Moore died.

De Blasio testily responded, "I was at the hospital Saturday, and I've been in many such situations. I don't necessarily agree with your interpretation."

He added, "I have been honored to stand by the [police officers of this department] in good times and bad, and I have done it many times, and I have done it in a way that was appropriate and in constant consultation with the leadership of this department."

Bratton stepped in to say, "It was on my advice that the mayor did not come to the hospital because of the uncertainty of the circumstances at the hospital during the morning," adding that the decision was made to allow Moore's body to be removed to Bellevue for an autopsy as quickly as possible.

Some NYPD officers turned their backs on the mayor at Woodhull Hospital following the shooting deaths Wenjian Liu and Rafael Ramos last December, a move they would repeat at the officers' funerals.

In a statement Monday, Detectives' Endowment Association President Michael Palladino blamed the City Council for "advocating" on the behalf of "criminals [who] are carrying their guns again because they've been emboldened with a warped sense of entitlement."

"At the same time, active policing has been discouraged or abandoned, leaving cops vulnerable and in danger. As a result, this young courageous cop lost his life," said Palladino, referring to the battle over stop-and-frisk.

Messages were left with the mayor's office and the City Council for comment on Palladino's statement.