After barely qualifying for the evening final in a performance that hinted at trouble ahead, Phelps struggled to a fourth-place finish and was denied his 17th career Olympic medal. When it was done, he could barely pull himself out of the pool.
"It was just a crappy race," Phelps said. "I felt fine the first 200, then I don't know. They just swam a better race than me, a smarter race than me, and were better prepared than me. That's why they're on the medal stand."
Lochte took the gold with a time of 4 minutes, 5.18 seconds. Brazil's Thiago Pereira (4:08.86) settled for silver, while Japan's Kosuke Hagino (4:08.94) claimed the bronze - beating Phelps by a fairly comfortable 34-hundredths of a second for the last spot on the podium.
It was the first time since the 2000 Sydney Games, when Phelps was a 15-year-old unknown who qualified in just one event, that he didn't win at least a bronze in an Olympic race. Since then, he was 16-of-16 - 14 golds and two bronzes.
Lochte climbed out of the pool with a big smile, waving to the crowd and looking about a fresh as he did at the start. He had predicted this would be his year and, for the first race of the Olympics at least, he was right on the mark.
"I think I'm kind of in shock right now," he said. As for Phelps, "I know he gave it everything he had. That's all you can ask for."
Phelps was trying to become the first male swimmer to win the same individual event at three straight Olympics. He'll have three more chances at a threepeat before he's done in London, having also won the 200 individual medley, plus the 100 and 200 butterfly, at Athens and Beijing.
But this was shocking, totally out of character for a swimmer who won six gold medals in Athens, then a record eight in Beijing to break Mark Spitz's Olympic record.
"I'm surprised, and not pleasantly," said Bob Bowman, Phelps' longtime coach. "I expected he'd be in the 4:06 range."
Bowman was asked what Phelps said when he got out of the pool.
"It was horrible."
The coach's reply?
With first lady Michelle Obama in the house waving a small U.S. flag, everyone expected a duel between the two American stars.
Only Lochte showed up.
Phelps fell behind right from the start in the butterfly, his trademark stroke. From there, it was all Lochte. He stretched his margin in the backstroke and breaststroke, then cruised to the gold in the freestyle, a good three body lengths ahead of the rest of the field.
"It's frustrating, that's all I can say. It's pretty upsetting," Phelps said. "The biggest thing now is to try to look forward. I have a bunch of other races, and hopefully we can finish a lot better than how we started."
China claimed a couple of gold medals on the opening night of swimming at the Olympic Aquatic Centre.
Sixteen-year-old Ye Shiwen set a world record in the women's 400 individual medley - only the third mark to fall since high-tech bodysuits were banned at the end of 2009. She won in 4:28.43, breaking the mark of 4:29.45 by Australia's Stephanie Rice at the 2008 Beijing Games. American Elizabeth Beisel took silver and China's Li Xuanxu grabbed the bronze.
Sun Yang flirted with a world record in the men's 400 freestyle. He took gold in 3:40.14, just off the mark of 3:40.07 by Germany's Paul Biedermann in a rubberized suit three years ago. When it was done, Sun propped himself on the lane rope, pumping his fist and splashing the water.
South Korea's Park Tae-hwan won silver in 3:42.06, fortunate even to take part after initially being disqualified for a false start in the prelims. The ruling was overturned by governing body FINA a couple of hours later on appeal. Peter Vanderkaay of the U.S. won the bronze in 3:44.69.
Australia captured gold in the women's 400 freestyle relay with an Olympic record of 3:33.15, rallying to pass the Americans and hold off the fast-charging Netherlands.
The U.S. got off to a blistering start with Missy Franklin swimming leadoff under world-record pace, and the Americans were still ahead after Jessica Hardy went next. But the Australians rallied behind Brittany Elmslie on the third 100, and Melanie Schlanger held on at the end, with Ranomi Kromowidjojo closing fast to give the Netherlands a silver in 3:33.79.
The other members of the winning team were Alicia Coutts and Cate Campbell.
The Americans slipped to the bronze in 3:34.24, but that was still good enough to give Natalie Coughlin the 12th medal of her career, tying Dara Torres and Jenny Thompson as the most decorated U.S. female Olympians in any sport.
Coughlin swam in the morning prelims, then was reduced to the role of cheerleader in the evening as the Americans went with Franklin, Hardy, Lia Neal and Allison Schmitt. Everyone who swims on a relay gets a medal, though.
There was no medal for Phelps.
His close call in the morning prelims put him in an already uncustomary position - swimming on the outside in the No. 8 lane. He only had one swimmer next to him and no idea what Lochte and the others in the middle of the pool were doing.
Not that it would have mattered.
"I don't think the lane had anything to do with it," Phelps said. "I just couldn't really put myself in a good spot for that race. It's frustrating for sure. ... It's just really frustrating to start off on a bad note like this."
Phelps still has six more events to swim in London, plenty of time to make up for his dismal start. He remains two behind the most medals won by any Olympian - Soviet gymnast Larisa Latynina's mark of 18.
Phelps put himself in position to swim another eight events with his performance at the U.S. trials, but he decided to drop the 200-meter freestyle, feeling one less race would give his body a better chance to recover and improve his performance in the other events.
Now, he may be regretting that decision.
The 400 IM was an event he has dominated, but he dropped it from his program after setting a world record in Beijing four years ago (4:03.84), vowing never to swim it again.
He should had stuck with that pledge. Clearly, Phelps didn't leave himself enough time to get back in the kind of shape he needed to win the brutal race, having only brought it back earlier this year.
"I was lucky to get in," he said, referring to his slow time in the morning. "I had a chance to put myself in a spot to start off on a good note and didn't do it."
Lochte gave the Americans their first gold medal of the London Games and put himself in position to fulfill the promise he showed at last year's world championships, where he won five golds and beat Phelps in their two head-to-head meetings.
The friendly rivals have one more showdown in London, in the 200 individual medley. Phelps edged Lochte in that race during the U.S. Olympics trials, but Lochte appears to be on top of his game when it really counts.
About a half-hour after the race, the laid-back Floridian returned to the medal podium to receive the fourth gold medal of his career.
Wearing diamond-studded grillz in his mouth and lime-green sneakers on the feet that powered him through the water faster than anyone else, Lochte strolled around the deck kissing his medal while Bruce Springsteen's "Born in the USA" played over the loudspeaker.
Phelps was nowhere to be found.