SACRAMENTO, Calif. (AP) — A California man has pleaded guilty to stabbing the U.S. airman who weeks earlier was hailed as a hero for helping thwart a terror attack aboard a French train.

Shelly Orio, a spokeswoman for the Sacramento County district attorney's office, says James Tran pleaded guilty to attempted murder Friday, less than a week before he was to go on trial.

The 29-year-old faces a nine-year prison sentence.

He admitted knifing Air Force Staff Sgt. Spencer Stone in 2015 during a fight near a Sacramento bar.

Stone is one of three Sacramento men who tackled a gunman with ties to radical Islam on a Paris-bound passenger train in August 2015.

Tran's attorney, Donald Masuda, did not immediately return messages from The Associated Press.

Tran is set for sentencing May 12.