The 16-year-old Ye trailed American teenager Elizabeth Beisel more than halfway through the grueling race but pulled away in the freestyle leg to win gold in 4 minutes, 28.43 seconds. She beat the mark of 4:29.45 set by Stephanie Rice at the 2008 Beijing Olympics.
Beisel settled for silver in 4:31.27, while China's Li Xuanxu took the bronze in 4:32.91.
Ye was the second Chinese swimmer to win gold on the opening night of swimming competition at the London Olympics. Sun Yang won the men's 400 freestyle.