Who would have thought this could happen at consecutive Summer Olympics? Who would have thought the United States and France would duel just like four years ago in the men’s 4x100 freestyle relay, with a massive lead obliterated on a furious, heart-thumping anchor leg that sent four stunned men, and at least a piece of an entire nation, into euphoria?

Only this time, it was the French team members, not those from the United States, who looked at the scoreboard in wonderment and celebrated like children. And this time, it was U.S. anchor Ryan Lochte who could not preserve a significant lead over the last 50 meters.

France’s Yannick Agnel overcame a half-second deficit and touched the wall in 3 minutes 9.93 seconds as Lochte came home in 3:10.38. Lochte’s late touch secured the first-ever Olympic silver medal for Michael Phelps, the 15-time medalist who swam a blazing second leg.

“I don’t think Ryan let anybody down,” said Cullen Jones, who swam the third leg and handed Lochte a lead of 0.55 of a second. “He’s beating up himself already. . . . [He] is the type of person who will beat on himself until the next Olympics.”

The outcome meant Lochte will not win the six gold medals he sought here; with one from the 400 individual medley Saturday night, the most he can claim is five. It meant Phelps is still seeking his first gold of these Games; on Saturday, he finished fourth in the 400 medley. Yet for Phelps, the race offered redemption of sorts. He swam the fastest leg of any U.S. team member (47.15) and second-fastest of the night, behind only Agnel’s 46.74.

Lochte tallied a 47.74 and Nathan Adrian managed a 47.89, fastest among the leadoff men. The United States, in fact, led until the last 50 meters, when Lochte was overtaken.

“We don’t consider it necessarily a loss,” Adrian said. “In my mind, we frame it as we won the silver medal. Whether or not that’s good enough for some people, whatever. . . . We went down fighting.”

The Russian team won bronze in 3:11.41 and the favored Australians placed fourth in 3:11.63. The French and Russian teams skipped the mandatory post-race news conference, as did Lochte and Phelps, who spoke only briefly to reporters immediately after the race.

“I was just really excited,” Lochte said. “I think I over-swam the first 50 which kinda hurt me for the last 50. You would think doing distance events, I wouldn’t get tired, but sprinting definitely takes a lot out of you.”

Lochte carried the burden of an additional event Saturday. Fewer than 90 minutes before the start, he competed in the 200 freestyle semifinals, advancing with the fifth-best time of the night. Phelps had dropped out of the 200 freestyle after winning the event at the U.S. trials for that reason; he said he did not want to be fatigued for the relays.

“I felt a lot better today than I did yesterday,” Phelps said. “I was happy I was able to put yesterday behind me and kind of move on today, and hopefully we can just move forward from here.”

The U.S. lineup was a brand-new one, and Gregg Troy, coach of the U.S. men’s team, did not announce it publicly until about an hour before the race. Troy put Lochte in the anchor leg for the first time in a major championship. He put Phelps, who has historically swum leadoff, in the second spot. And he put Adrian, the U.S. 100 champion who has previously anchored the team, on the blocks.

The move seemed to work brilliantly at first. Adrian outswam reigning world champion James Magnussen of Australia, covering the first 100 in 47.89 and giving the United States a lead of 0.14 of a second. Phelps expanded the lead, touching the wall 0.76 ahead of Fabien Gilot of France. Then Jones, the silver medalist in the event at the U.S. championships, fended off a fast-closing Clement Lefert with a leg of 47.60.

When Lochte dived in, the race seemed to be over. It wasn’t just the lead, it was the recent history of the French team in the event. At the 2008 Summer Games, as Phelps sought to continue his record eight gold-medal quest, anchor Jason Lezak — who swam here in the morning heats — laid down the fastest relay leg in history, coming from behind against French freestyle giant Alain Bernard to give the U.S. team a narrow victory.

A year later at the world championships in Rome, the favored French faded again as Adrian swam a brilliant anchor leg. This time, however, it was different.

“We were all just like screaming and screaming [at Lochte], ‘Get to the wall! Don’t die!’” Jones said.

Once dominant in this event, the U.S. team has a new streak: two straight defeats at major events. At last year’s world championships, the men earned the bronze medal after having won gold at the previous six major world or Olympic championships. The U.S. team had won the event at seven straight Olympics before 2000, when it lost to Australia.

“We had our best four guys, and we went out there to win it, and we came up short,” Lochte said. “I’m kinda bummed because when we go up on the blocks we always want to win.”