Nikolas Cruz, the 19-year-old accused of going on a shooting rampage at Marjory Stoneman Douglas High School on Valentine’s Day, took an Uber to the school,according to court records released Thursday.

The Associated Press reported Uber confirmed that Cruz used the service before the shooting. The company would not answer questions about if the Uber driver noticed strange behavior from Cruz, or whether he was carrying a gun.

The company said it is helping law enforcement with the investigation.

RELATED: Who is Nikolas Cruz, accused gunman in Florida high school attack?

According to the document charging Cruz with 17 counts of premeditated murder, a witness saw Cruz and recognized that he was a troubled student. He was wearing black pants, a black hat and a burgundy shirt. He carried a duffle bag and wore a black backpack.

The minute the witness heard gunshots, a “code red” was called, the report said.

Cruz told police he was that gunman.

As students fled, Cruz said, he thought up a plan to discard the AR-15 rifle and the extra magazines he had in his backpack so he could slip out with the other students. Police found the items where Cruz said they would be.

Broward County Sheriff Scott Israel said at a news conference Thursday that Nikolas Cruz tried to mix in with a group of students fleeing the school. The sheriff says he then headed to a Wal-Mart and bought a drink at a Subway restaurant before walking to a McDonald’s.

Cruz remained in jail Thursday. A judge denied bond for the former high school student. He has been placed on a suicide watch.