U.S. President Barack Obama meets with Spencer Stone (2nd L), Anthony Sadler (R) and Alek Skarlatos (L), the three men who subdued a gunman on a Paris-bound train in August, at the Oval Office on Sept. 17, 2015. (Carlos Barria/Reuters)

They tackled a terrorist. Now they’re ready to tackle a book.

Anthony Sadler, Alek Skarlatos and Spencer Stone, the three American friends who beat a would-be killer unconscious and saved a train full of people traveling to Paris last August, have sold their life story to PublicAffairs.

“The 15:17 to Paris” will be published this summer on the one-year anniversary of the act of heroism that earned the three men the French Legion of Honor.

The highlight of the book will be the reenactment of the thwarted attack on Aug. 21, when Ayoub el-Khazzani, a suspected Islamist militant, began shooting. Stone, an Airman 1st Class, knocked down Khazzani and grabbed him around the neck even while the gunman was slicing him with a box cutter. Skarlatos, serving with the Oregon Army National Guard, and Sadler, then a senior at California State University at Sacramento, helped disarm and restrain Khazzani.

A statement released Tuesday by Perseus Books Group describes the upcoming book as “the gripping true story of a terrorist attack that would have killed more than 500 people if not for their actions, but it is also the story of three American boys, their friendship, and the values we hold dear.”

The book deal is hardly a surprise, considering the fame the three men have enjoyed since their brave actions on the train. All of them have been invited to the White House. Skarlatos competed on “Dancing with the Stars.” Stone was a special guest at last week’s State of the Union address.

PublicAffairs plans a six-figure first printing. Jeffrey E. Stern, an international journalist, will co-write the book.

David Steinberger, president and chief executive of Perseus Books Group, declined to provide financial details on the deal on the deal, but said, “This was an auction, and we were aggressive in spending to acquire the rights because we had a lot of conviction right away, based on the material, that this was going to be an important book and one that readers were really going to respond to.” He said he is “confident that this is going to be a film. It’s extremely cinematic, and there’s a lot of interest in the movie.”

Reached by phone at his mother’s house in Sacramento, Stone sounds just as modest and easygoing as you’d want an American hero to be.

“I never thought I’d be writing a book,” Stone says. “People kept telling us, ‘You guys should write a book.’ We were like, ‘What are we going to make a book about?’ We can’t make a whole book about a two-minute fight.”

But “The 15:17 to Paris” will delve into the lives of the three men and their long friendship. “It’s a trip,” Stone says, “but it’s kind of difficult, trying to remember everything in detail. . . . I’m excited to see how it comes out.”

Stone acknowledges that he and his two friends have “a different idea” of the attack that interrupted their European vacation. “There’s what Alek saw,” he says. “There’s what Anthony saw. But Anthony didn’t see it from our perspective, so he’s like, ‘Wow, that happened?’ We all have three different perspectives. ‘No, that’s not what happened.’ And I’m like, ‘No, that happened, and I know!’ ”

Stern recently completed extensive interviews with Stone. “I took him places and told him stories about growing up,” Stone says, “so he could see in person the people in my past. And he hung out with my family, and we became pretty good friends.”

Stone expects that it will be “very weird” to read a book about himself and his buddies. “It’s probably going to seem a little more dramatic than it seemed to me.”

The months since the train attack have been only slightly less harrowing for Stone. In October, he was stabbed several times several times during a late-night brawl in Sacramento and required open-heart surgery to save his life. “I am doing a lot better,” he says. “You know, it’s still actually healing. Doctors told me, ‘You’re not going to be 100 percent.’ ”

For now, Stone is concentrating on recovering and looking forward to the book tour.

“Our own book tour — that would be mind-blowing,” he says. “It would be like we’re on vacation, but hopefully no terrorists this time.”