Onigami Den

Legend of the Millennium Dragon (鬼神伝, Onigamiden) is a 2011 Japanese anime film.

Plot
A 15-year-old boy travels back in time —over 1,200 years ago to the Heian period— and faces a war between oni (demons) and humans in the former Japanese capital of Kyoto.