Early on Wednesday morning, a sergeant and three police officers patrolling the East Elmhurst neighborhood of Queens spotted a black Ford Explorer with an obscured license plate.
When they pulled the driver over at about 1:30 a.m., they found a cache of weapons inside: a 9-millimeter Glock, 179 rounds of ammunition, four high-capacity magazines, two axes, four knives, a stun gun, an expandable baton and a black whip, officials said.
Along with the weapons, the police also found an New York Police Department vest, handcuffs, a bright-orange Metropolitan Transportation Authority vest and a grinning Guy Fawkes mask that resembled the one worn by the protagonist in the dystopian 2006 movie, “V for Vendetta.”
Behind the wheel was a 27-year-old man the police identified as Judd Sanson. On Thursday, he was arraigned in Queens Criminal Court on charges including firearm possession, 10 counts of criminal possession of weapons in the fourth degree and the unlawful use of a police uniform or emblem.
At a news conference on Thursday, Melinda Katz, the Queens district attorney, said investigators would examine Mr. Sanson’s social media accounts and any computers he owned to find out whether he had planned to commit a violent crime.
“We are going to actually find out what his intent is,” she said.
Etched into the expandable baton were the words “Left me no choice,” “I am sorry” and the Arabic phrase for “God, forgive me,” prosecutors said in court Thursday.
Such “threatening” language, and the fact that Mr. Sanson was stopped near La Guardia Airport, were “concerning,” Ms. Katz said.
During Mr. Sanson’s arraignment, Dylan Nesturrick, an assistant district attorney, said that when Mr. Sanson was stopped, the police found the whip and one of the axes hanging from the ceiling of the Explorer.
The gearshift had been replaced with a sword hilt, Mr. Nesturrick said.
Mr. Sanson’s lawyer, Thomas Montella, asked for bail, describing Mr. Sanson as a self-employed mechanic who had visitation rights to his 1-year-old child.
But Judge Julieta V. Lozano ordered that Mr. Sanson be held, saying that he might flee.
Shortly after Mr. Sanson’s arrest, the police searched the Queens apartment he shared with his father. The police found an empty gun case with a serial number that did not match the Glock that had been found in the Explorer, Mr. Nesturrick said.
Th police in East Elmhurst had already been on high alert following the shootings of two officers on June 3. Both survived.
The officers who encountered Mr. Sanson’s car on Wednesday had been investigating robbery patterns and searching for illegal mopeds, Jeffrey Maddrey, the chief of the department, said during a news conference that day in Queens announcing the arrest.
The police said they are also cracking down harder on ghost cars — vehicles with altered or forged license plates.
Often the intent is to avoid fares and tolls, Kaz Daughtry, the Police Department’s deputy commissioner of operations, said at the news conference. But, he said, 80 percent of the people who commit shootings, home invasions or robberies use license plate covers to help hide their crimes.
So far this year, the police have confiscated more than 3,500 vehicles with obstructed or forged plates, he said.
Chelsia Rose Marcius contributed reporting.