T. J. Miller, the comedian and former star of the HBO series “Silicon Valley,” was arrested Monday night at La Guardia Airport and charged by federal law enforcement authorities with calling in a false bomb threat from an Amtrak train, the United States attorney’s office in Connecticut said Tuesday.

The charge, which carries a maximum five-year jail sentence, stems from March 18, when the authorities said Mr. Miller alerted a 911 dispatcher in New Jersey that a female passenger was hiding a bomb in her bag on Amtrak Train 2256, which he said he was on, and which was headed north from Washington. He described the female passenger as having brown hair and a scarf.

Law enforcement alerted Amtrak, disrupting service, but by the time the train was stopped and searched, it was already in Westport, Conn. Passengers were ordered to evacuate while bomb squads searched the train and found no evidence of any explosive materials.

It turned out that Mr. Miller had been on a different train — Amtrak Train 2258 — which pulled into Westport soon after. According to the complaint, when investigators again contacted Mr. Miller, who was then in New York, he described the woman as having red hair, rather than brown, and said she had a black carry-on suitcase with a handle. Mr. Miller said she seemed eager to get off the train while leaving her bag aboard.