The man who allegedly brought gas cans and lighter fluid into St. Patrick's Cathedral in New York City has taught philosophy at different colleges in New York and New Jersey, school officials said.

Marc Lamparello, 37, was arrested on Wednesday night and was charged with attempted arson and reckless endangerment. He was taken into custody after a security guard at the cathedral on Fifth Avenue in Manhattan spotted him.

RELATED: MAN CAUGHT WITH 2 GAS CANS ENTERING ST. PATRICK'S CATHEDRAL IN NYC, POLICE SAY

He was cooperative but acted evasively, the New York Police Department said. Lamparello allegedly told officers that he was “cutting through the cathedral to get to Madison Avenue” and that "his car ran out of gas," police said. But when police reportedly checked the man's minivan, its gas tank wasn't empty.

John Miller, the NYPD's deputy commissioner of intelligence and counterterrorism, said surveillance camera footage showed Lamparello circling St. Patrick's several times in a minivan well over an hour before he parked outside the cathedral on Fifth Avenue, walked around the area, returned to his vehicle, and retrieved the gasoline and lighter fluid.

The incident at the cathedral came two days after Notre Dame Cathedral in Paris was ravaged by a fire that investigators said Thursday was most likely electrical. After Lamparello's arrest, police said there "doesn't appear to be any connection to any terrorist group or any terrorist-related intent here."

Lamparello was also arrested on Monday in Newark, New Jersey after he allegedly wouldn't leave the Cathedral Basilica of the Sacred Heart at closing time after a late Mass.

NOTRE DAME FIRE LIKELY CAUSED BY ELECTRICAL SHORT-CIRCUIT, INVESTIGATORS BELIEVE

The man was calm and respectful to officers but was adamant about not leaving the cathedral, according to the Essex County Sheriff's Office.

"He said, 'This is a house of God, it should be open, I'm not leaving. You'll have to lock me up,'" Sheriff Armando Fontoura said.

CLICK HERE TO GET THE FOX NEWS APP

Lamparello has worked as a part-time online instructor at Lehman College in New York, and taught philosophy as a part-time adjunct instructor at Seton Hall University in New Jersey, both schools confirmed to Fox News on Thursday.

Brooklyn College said in a statement that because Lamparello is a PhD student at the College of New York's Graduate Center, he is required to teach a course on campus, and was assigned to the school.

Sarah Ramsey, a spokesperson for Lehman, said the school is aware of what happened at St. Patrick's Cathedral, and is "taking appropriate steps to terminate the individual's employment with the college," while Seton Hall said Lamparella is no longer working with the university, as their "top priority is the education and welfare of our students and the entire campus community."

The Associated Press contributed to this report.