Ariarne Titmus defeats Katie Ledecky in the 400-meter freestyle.

In one of the most anticipated showdowns of the Tokyo Games, Ariarne Titmus of Australia defeated Katie Ledecky of the United States in the 400-meter freestyle, beating the reigning champion by two-thirds of a second.

Ledecky, the world-record holder in the event, came in as something of an underdog. Titmus beat her at the world championships two years ago when Ledecky was ailing. She’s been faster than Ledecky at the distance this year.

Titmus is the only swimmer to beat Ledecky in a distance race at a major meet and had put a target on Ledecky’s back, saying at Australia’s Olympic trials that the American champion would have things “all her way” in Tokyo.

She backed up the talk in the pool Monday morning, overpowering Ledecky down the stretch in one of Ledecky’s signature events. Ledecky had the lead until the final 100 meters. Titmus, swimming in the lane beside Ledecky, came off the wall with a little more than the defending gold medalist and stretched out her lead over the final 50 meters.

Ledecky has long been considered nearly untouchable at any distance of more than 200 meters.

But swimming is the ultimate sport of one-upsmanship — one swimmer sets a seemingly unmatchable standard, only to see a new collection of swimmers match it far sooner than anyone anticipated.

That is what has happened with Titmus, a 20-year-old Tasmanian, who has come on like a force of nature in the last three years, testing Ledecky’s fierceness as a competitor as it has rarely been tested before. On Monday, that fierceness was on full display as Ledecky put up a fight, but Titmus had just enough to outlast her in the final meters.

Ledecky is also competing in freestyle races at 200, 800 and 1500.