By May, it was decided: Three friends who met as middle-schoolers in California would take a European vacation.

“I’m going to Europe!!!! Like wow,” Anthony Sadler, 23, wrote on Twitter on May 14, three months before jetting off with Alek Skarlatos, 22, and Spencer Stone, 23.

On his first international trip, he planned to spend three weeks traveling across Italy, Germany, the Netherlands, France and Spain with Mr. Skarlatos and Mr. Stone, two of his closest friends, both of whom are in the Armed Forces. Mr. Skarlatos is a specialist in the Oregon National Guard; Mr. Stone is an airman in the Air Force.

Meals and sightseeing were part of the itinerary. Disrupting an act of terror was not.

But on Friday, they did just that, tackling and subduing a gunman on a high-speed train to France. The next day, their faces were on televisions around the world, and they were being hailed as heroes.