The Aquatics Centre also bore witness to the first women's long-course world record since the ban on performance-enhancing suits, with Ye Shiwen lowering the 400m Individual Medley mark with an astonishing last two lengths.
Ye's fellow Chinese athlete, Sun Yang, was just seven hundredths of a second outside the 400m Freestyle world record, his apparently languid stroke helping propel him to the Olympic title while Australia set a new Olympic mark to win the women's 4 x 100m Freestyle Relay.
The men's 400m Medley was meant to be the first instalment of a showdown between Lochte and Phelps but ultimately the former was never threatened and touched in 4:05.18.
Brazil's Thiago Pereira was second with Japanese 17-year-old Kosuke Hagino third, just a year after taking bronze at the World Junior Championships.
Phelps was third at the halfway stage before dropping out of the medals on the breaststroke leg, the Baltimore swimmer unable to claw back the deficit to finish fourth.
Phelps pulled no punches about his performance, saying: 'Frustrating. That's all I can say. It's pretty upsetting. But I think the biggest thing now is just to try to get past this and move forward.
Frustrating. That's all I can say. It's pretty upsetting. But I think the biggest thing now is just to try to get past this and move forward.Michael Phelps
'I have a bunch of other races and hopefully we can finish a lot better than we started. That's what I'm going to try to do.'
For Lochte, his emotions were in complete contrast.
'Going into the race, I was so excited to get a final, so I went a little too hard in the first 50 of the fly. I kept looking at the scoreboard, I knew it wasn't going to be just me and Michael - there were other great swimmers in the race.
'When I hit the wall I was in shock, I think I still am, to have won.'
In the 400m Freestyle, Sun finished in 3:40.14, an Olympic record and just outside Paul Biedermann's 2009 mark.
Ye produced an astonishing final 100m of 58.68 to lower Stephanie Rice's 2008 world record in the women's 400m IM, clocking 4:28.43.
Elizabeth Beisel was second, with Ye's compatriot Li Xuanxu third.
Australia set a new Olympic record of 3:33.15 to win the women's 4 x 100m Freestyle Relay.