Lochte added the Olympic gold medal to the world title he won in Shanghai last year when he cruised to a surprisingly lopsided victory in four minutes 05.18 seconds.
Brazil's Thiago Pereira won the silver medal after finishing second in 4:08.86 while Japanese teenager Kosuke Hagino collected the bronze for finishing third in 4:08.94.
Phelps, who won the gruelling event at the past two Olympics, faded to finish fourth in 4:09.28, more than five seconds outside his world record.
The race, a lung-bursting test to decide the world's best all-round swimmer, was billed as one of the great rivalries of the London Games but failed to live up to all expectations as Lochte stormed away to win easily.
Phelps was swimming in the outside lane after just scraping into the final as the slowest qualifier and was never a threat.
The last time Phelps, who won eight gold medals in Beijing four years ago, was beaten in an Olympic final was when he came third behind Ian Thorpe and Pieter van den Hoogenband in the 200 freestyle at Athens, which was dubbed the "race of the century."
He has entered seven events in London and needs to win three medals to break the all-time record of 18 held by Soviet gymnast Larisa Latynina.
For Lochte, it was his fourth gold medal and the first of what is expected to be several more in London.