According to the release, Moreno, 44, ran a locomotive off the end of the tracks and crashed through multiple barriers before the train stopped more than 250 yards from the ship.

A California Highway Patrol officer witnessed the crash and took Moreno into custody as he fled the scene, the news release said. Los Angeles Port Police later took custody of Moreno.

The CHP officer said he saw “the train smash into a concrete barrier at the end of the track, smash into a steel barrier, smash into a chain-link fence, slide through a parking lot, slide across another lot filled with gravel, and smash into a second chain-link fence,” according to the affidavit.

According to the officer, Moreno made statements including, “You only get this chance once. The whole world is watching. I had to. People don’t know what’s going on here. Now they will.”

There were no injuries in the incident and no damage to the Mercy.

Hazardous material personnel had to clean a substantial amount of fuel oil that leaked from the train.

The FBI’s Joint Terrorism Task Force and the Port of Los Angeles Police are leading the investigation.

In a second interview with the FBI, Moreno said “he did it out of the desire to ‘wake people up,’ ” according to the affidavit. “Moreno stated that he thought that the U.S.N.S. Mercy was suspicious and did not believe ‘the ship is what they say it’s for.’ ”

Moreno was held overnight on local charges and was expected to make his first appearance in federal court Wednesday, the news release said.