A passenger who caused an evacuation at John F. Kennedy International Airport has told law enforcers that he breached security after going outside to smoke and then misplacing his boarding pass.

William Contreras Ramos, 20, of San Lorenzo, Puerto Rico, told authorities that he was running late Tuesday and didn't have his boarding pass, so he went through another door and was able to get to his flight's gate.

The Port Authority of New York and New Jersey, which runs the airport, called Albany County Sheriff James Campbell to say the man had boarded a plane to Albany. Deputies there took him in for questioning.

Ramos had no weapons on him, but a straight razor was found in his carry-on luggage, Campbell said. Ramos was being detained Wednesday until the FBI could come get him, Campbell said.

Ramos was arraigned Wednesday on a charge of carrying a concealed, dangerous weapon onto an aircraft, the Times Union of Albany reported.

The security breach caused two terminals to be evacuated and passengers to be re-screened, the federal Transportation Security Administration said. Thousands of passengers and dozens of flights were delayed for several hours during the evacuation and subsequent security rescreening.

The passenger walked up an exit lane past a private security guard at terminal two at about 6:40 p.m. Tuesday, the TSA said. The guard could not immediately locate the passenger and notified the TSA of the security breach, sparking a wide search for the man at terminals two and three, the federal agency said.

"He was going through the exit lane. That's going the wrong way," TSA spokesman Norm Brewer said. "As I understand it, he was challenged and stopped. And then what happened, I do not know."

The TSA said in a statement on its Web site that "there is no known nexus to terrorism at this time."

Brewer said Aviation Safeguards, a division of Command Security Corporation, operates private security at JFK airport. Calls to the company were not immediately returned.