For the 2012 Summer Olympics, Sun was considered a favourite in the 400 metre and 1500 metre freestyle, as well as a contender in the 200 metre freestyle. In his first event, the 400 metre freestyle, he won the gold medal with a time of 3:40.14, breaking the Olympic record previously held by Ian Thorpe and becoming the first Chinese male swimmer to win a gold medal at the Olympics. His time was also the third fastest in history, 0.07 seconds away from the world record, and setting a new Asian record. After a day of recuperating, Sun competed in the 200 metre freestyle. He won a silver medal in the final, tying with Park Tae-hwan with a time of 1:44.93, a new national record. The following day, Sun swam the anchor leg in the 4 × 200 metre freestyle relay to help the Chinese team win bronze, China's first Olympic medal in a men's relay event.