Greg Meehan, the United States women’s head coach and Ledecky’s personal coach for the past three years, said he had seen nothing to make him think her fourth consecutive World Championship title in the event was in jeopardy.

“I think she swam a beautiful first 300, just really executed the plan,” said Meehan, who had no explanation for why Ledecky had struggled on the final lap. “Sometimes things just happen,” he said, “and it’s hard when it’s someone of Katie’s persona.”

Titmus, too, seemed surprised that Ledecky had been close enough to catch down the stretch. Titmus had finished fourth, six seconds behind Ledecky, at the 2017 World Championships in Budapest and second to her, by 1.16 seconds, at the 2018 Pan Pacific Championships in Tokyo.

“I never thought I’d find myself in a situation where I’d be mowing Katie down,” said Titmus, whose best time coming into the meet was a 3:59.35. “She’s such a champion. I didn’t think I’d be in that situation, so I tried to make the most of it.”

Ledecky acknowledged that she was not used to having to ward off a late challenge. Her fastest 2019 time — 3:59.28, from a meet last month in Santa Clara, Calif. — was four and a half seconds better than that of the next-fastest American, Smith. At the past two World Championships, Ledecky’s average margin of victory in the event was 3.5 seconds.

Ledecky looked shellshocked during the medal ceremony. She recovered her equanimity in time to nudge Titmus in the right direction for the medal parade around the pool deck.