Chen built on a strong lead in the short programme with a dynamic free skate that included four clean quadruple jumps and had the crowd at Saitama Super Arena, just north of Tokyo, clapping along by the end.
The 19-year-old Chen broke the world record for both the free skate and total points, set moments before by Hanyu, surging to victory with 216.02 and a total of 323.42.
"As soon as I stepped on the ice, I felt that energy already there. He (Hanyu) has been pushing the sport making the sport so enjoyable, so competitive, and that definitely made me so much better of a
Hanyu, 24 and competing in Japan for the first time in several years, brought the house down with a routine that began with a clean quadruple loop and hit two more clean quads, with a quad Salchow under-rotated.
In a routine that was haunting and energetic, Hanyu, who had not competed for four months due to an ankle injury, racked up 206.10 points in the free skate and 300.97 in total, breaking the record he set in a Helsinki Grand Prix event in 2018.
Yet it was only enough for silver.
"I had one mistake in my free programme but I am pleased I could perform well at the world championships," said Hanyu, whose fans cheered ecstatically when he landed his jumps.
Hanyu, who is known as a perfectionist, added that he was far from satisfied with the result.
"I really want to win. I think I did my best, but the problem is that in figure skating competition consists of two days, and I am losing in both," he said.
"I am a really competitive person and want to compete with a strong opponent. I respect Nathan in this sense."
Chen sets world record to defend title in mesmerising display
American 18-year-old Vincent Zhou finished third with a dynamic and powerful routine that helped him rise a place from the short programme, claiming 186.99 points for a total of 281.16.
"It wasn’t perfect but I am more than happy with that. It felt unbelievable doing that out there," he said.