Amtrak and the Transportation Security Administration deployed officers from about 100 local police departments to 150 train stations in 13 states and the District of Columbia during the morning rush on Tuesday in a drill to familiarize law enforcement personnel with the rail system and to practice working together. An Amtrak spokesman said some travelers were asked for identification and some were told to open their bags for inspection.

In many cases, the exercise meant mostly that more police officers were present in Amtrak and commuter rail stations, although some commuters may not have noticed. In some stations, police dogs were present.

Officials said the drill, along the Northeast corridor from Virginia to Vermont, was not in response to any threat, but was meant to demonstrate how the authorities could respond to one, or to an actual attack. Participating agencies included police departments from small jurisdictions, like Kingston, R.I., and Old Saybrook, Conn., Linden and Metuchen, N.J., Lower Merion, Pa., and Harpers Ferry, W.Va., as well as from big cities, including Boston, New York, Philadelphia and Washington.

At Union Station in Washington, a few blocks from the Capitol, there was a noticeable increase in the security presence. Transportation Security Administration officers who said they were ordinarily assigned to Ronald Reagan Washington National Airport stood near a busy Starbucks, watching passengers who had just arrived on an Acela from New York. “It’s national rail security day,” one officer said cheerily, as if it were a new holiday. He said he was not authorized to give his name to the press.