Merritt took the race out from the gun and went hard over the first 200 but, unlike James, the American had plenty left in the tank coming into the home straight to seal victory in a world-leading 43.74 seconds.
His compatriot Tony McQuay made it a one-two for the U.S. who have now won all but four of the men's world titles in the event, in 44.40.
Fast-finishing Luguelin Santos of the Dominican Republic edged out Belgium's Jonathan Borlee for bronze in 44.52.
"I've said it many times already, I was hungry. Probably the hungriest person in the field," Merritt told reporters.
"Not only was I starving for a great performance, I was also starving like I didn't eat a lot today, so I was really starving. I wanted to go out and put a great race together, I was ready mentally and physically to put a 43 together, and that's what I did."
Merritt, the 2009 champion, held a slight lead as he and James came off the final bend and with arms pumping high, the
American seemed to have endless reserves of energy as James he went backwards through the field.
"It was poor execution on my end, I need to go back to the drawing board and think again," James told the BBC.
"I didn't come to the world championships expecting this. I just need to move on now."
Merritt returned from a 21-month doping suspension in 2011 after a positive test for using an over-the-counter male enhancement product that contained a banned substance and promptly lost his world title to the then teenage upstart, whose victory prompted street celebrations in his home country.
Having been outsprinted by James in Daegu in 2011, Merritt then lost his Olympic crown last year to his young rival after pulling up with a hamstring injury in his heat.
"I've always worked hard, even last season I had an undefeated year up until the Olympic Games. Just unfortunately I got hurt, I was ready to go last year," the 27-year-old said.
Merritt has been back with a bang this year and coming into the championships was the only man to have got the better of James this season, at the Eugene Diamond League in June.
"It isn't a shock that Merritt won the race, it is the way he won the race and the way James lost it," world record holder Michael Johnson told the BBC.
"James didn't want to run too fast too early but he had to, to keep up. Kirani had nothing left to give at the crucial moment."
- Sports & Recreation