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.
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. South Korea's Park Tae-hwan was the silver medalist 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.
Phelps' 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.