Two men armed with a hunting knife and gun were arrested Friday at Penn Station wanted in connection with planning harm to the Jewish community, officials said.

The FBI/NYPD Joint Terrorism Task Force, NYPD Counterterrorism and Intelligence Bureau investigators worked together to uncover a developing threat that occurred Friday, according to the NYPD.

Police said in a statement that the teams worked quickly to gather information, identify those involved and “operationally neutralize their ability to do harm.”

The two individuals, Christopher Brown of Aquebogue and Matthew Mahrer of Manhattan, were arrested by MTA police officers while entering Penn Station, officials said. 

During the arrest, police discovered a large hunting knife, an illegal Glock 17 firearm, a 30-round magazine and other items, the NYPD said.

Brown, 21, was charged with making terroristic threat, aggravated harassment and criminal possession of a weapon, while Mahrer, 22, was charged with criminal possession of a weapon, according to police.

In response to the arrest, the NYPD said it is deploying officers at certain locations throughout the city.

“As a joint investigation now continues to establish a strong prosecution, Police Department commanders are strategically deploying assets at sensitive locations throughout New York City,” Police Commissioner Keechant L. Sewell said in a statement.

“And I join all New Yorkers today in expressing my gratitude and pride for the ever-vigilant work of our NYPD women and men — who remain on-guard around-the-clock and every day to protect the peace and ensure no violence can ever come to the city and its people,” she said.

MTA Chief of Police John Mueller also commented on the MTA polices' response to the arrests.

"The tremendous police work here reflects the MTA PD's core purpose - protecting millions of daily commuters, in collaboration with our local, state and federal law enforcement partners," Mueller said in a statement.

"Today, their vigilance & heroic work by @MTA police officers helped stop a threat to our Jewish communities," Gov. Kathy Hochul tweeted Saturday evening. "Grateful to law enforcement for keeping New Yorkers safe."

Earlier this month, a man was arrested and charged with making an online threat against synagogues in New Jersey.