The Heian period was a time when human beings and various supernatural beings still coexisted with each other, the latter occasionally causing trouble to humans. Practitioners of the art of onmyōdō, the onmyōji, were held to be able to control and subdue these malevolent entities and other paranormal phenomena, and were thus held in high regard, being employed by the imperial court.
In Heian-kyō, nobleman Minamoto no Hiromasa meets court onmyōji Abe no Seimei, a mysterious man about whom many rumors have been told. On a dare by some courtiers, Seimei demonstrates his exceptional skills in onmyōdō by killing a butterfly without touching it (i.e. casting a spell on a leaf which then flies and cuts through it).
Hiromasa later visits Seimei at the latter's home, where he sees Seimei's shikigami in human form, one of whom was Mitsumushi, the butterfly he had killed (and subsequently revived) earlier. Seimei joins Hiromasa in inspecting a mysterious gourd growing from a pine tree in Lord Kaneie's house; Seimei reveals the gourd to have been caused by a curse cast by a former lover of Kaneie who committed suicide.
One night, Hiromasa impresses an unseen lady on an oxcart with his flute playing. Unbeknownst to him, this woman is Sukehime, Minister of the Right Fujiwara no Motokata's daughter and one of the current emperor's wives, who is worried that she is losing the emperor's favor as another wife, Lady Tōko, the daughter of Minister of the Left Fujiwara no Morosuke, had just given birth to a baby boy, who is to be the heir to the throne.
Meanwhile, the head onmyōji of the imperial Bureau of Onmyō, Dōson, is secretly plotting to overthrow the emperor by trying to awaken the vengeful spirit of Prince Sawara, who had died 150 years ago. Wrongfully accused of treason by his brother, the Emperor Kanmu, Sawara committed suicide, but not before swearing eternal vengeance on the Son of Heaven (i.e. the emperor). When Dōson curses the emperor's newborn son, Prince Atsuhira, to be possessed by an evil spirit, Seimei combats his spells and drives the demon away with the help of Hiromasa and the immortal Lady Aone, who was ordered by Kanmu to guard the burial mound where Prince Sawara's spirit is sealed away.
Hiromasa once again meets Sukehime (again unseen by Hiromasa) on the oxcart. He confesses his feelings for Sukehime, who he calls 'Lady of the Full Moon' (望月の君 Mochizuki no kimi), but Sukehime, who still loves the emperor, rejects his advances.
Both Seimei and Aone are put under arrest by Motokata and accused of cursing the infant prince. They are saved in the nick of time by Morosuke, who points out it is unlawful to kill a court onmyōji without imperial permission. Dōson, who is implied to be behind the allegation, enchants one of the imperial police to attack the two; Aone is severely wounded, but proves to be unharmed due to her immortality.
Taking advantage of Sukehime's jealousy against Tōko, Dōson uses his powers to turn her into a namanari (a woman halfway to becoming an oni) that harasses both Tōko and the newborn Atsuhira. Seimei uses onmyōdō to transform straw effigies into the likenesses of the Emperor and the infant prince. Sukehime arrives and assaults the effigies, thinking them to be the real emperor and Atsuhira. The emperor, moved by a waka poem she recites (the same poem Hiromasa hears the lady on the oxcart recite earlier), speaks out loudly, breaking Seimei's spell. Hiromasa, recognizing Sukehime to be his 'Lady of the Full Moon', steps in to accost her.
Sukehime briefly comes back to her senses when Seimei removes a paper talisman attached to her back, but Dōson doubles his efforts, and she completely transforms into an oni. When Hiromasa sacrifices himself by allowing her to bite on his arm, Sukehime comes back to her senses once more and kills herself with Hiromasa's tachi. In her final moments, Sukehime - now a human once more - begs to hear Hiromasa's flute one last time.
Seimei shoots an arrow with the paper talisman towards the sky, ordering the curse to go back to its sender. The arrow, now on fire, lands in Dōson's secret lair, burning it to the ground. Dōson, swearing vengeance on Seimei, finally releases the spirit of Prince Sawara from its confinement in the burial mound. Sawara's ghost enters Dōson's body and summons a horde of vengeful spirits to attack Heian-kyō. Aone reveals to Seimei that he and Hiromasa are foretold by the stars to become the two protectors of the city: one cannot survive without the other. She, Seimei and Mitsumushi then go off in search of Hiromasa.
Dōson makes his way to the imperial palace. Hiromasa tries to stop him in his tracks, but he is no match for his superhuman abilities; he is mortally wounded when Dōson throws back an arrow Hiromasa shot towards him. Seimei and Aone find him, but it is too late. Aone suggests that Seimei resurrect Hiromasa by performing the rite of Taizan-fukun, the Chinese god of the dead (泰山府君祭 Taizan-fukun no matsuri), offering to sacrifice her immortality and life to do so.
Hiromasa, brought back to life by the ritual, and Seimei go to face Dōson. Aone's spirit, speaking through Hiromasa's body, convinces Sawara to give up his hatred. While Sawara at first refuses to do so, he is finally moved by the prospect of being with Aone - who was the prince's lover during his lifetime - forever; he then passes peacefully with Aone into the afterlife. Although now without Sawara's spirit to empower him, Dōson resumes the fight. Seimei, using his wits, traps Dōson within a magical barrier. Finally admitting defeat, Dōson slashes his throat with the sword from Sawara's burial mound.
At the end of the movie, Seimei and Hiromasa drink sake together in Seimei's house. Hiromasa teases Seimei for crying when he died and reflects on what Seimei said to him earlier: that the human heart can turn one into a demon or a buddha. Seimei tells Hiromasa that he is a 'very good man'; Hiromasa answers, "So are you." The two share a laugh together.Mansai Nomura as Abe no Seimei (安倍清明): An exceptionally talented onmyōji whose very origins are shrouded in mystery. Although an onmyōji of the imperial court, he initially shows little regard for it or Heian-kyō itself, preferring instead to stay home with his shikigami and drink sake, yet eventually finds himself fulfilling his destined role as the capital's protector along with Hiromasa.
Hideaki Ito as Minamoto no Hiromasa (源博雅): A nobleman in the court with a bumbling personality skilled in playing the flute. Although wary of onmyōji at first, he eventually becomes close friends with Seimei, being destined to become the guardian of Heian-kyō along with him.
Eriko Imai as Mitsumushi (蜜虫): A butterfly killed by Seimei as a display of his power and subsequently brought back to life. She now serves him as one of his shikigami.
Hiroyuki Sanada as Dōson (道尊): The head of the Bureau of Onmyō (陰陽寮 Onmyō-ryō), he secretly plots the downfall of the imperial line and attempts to use the vengeful spirit of Prince Sawara to further his goals.
Ittoku Kishibe as the Emperor (帝 Mikado): Loosely based on the historical Emperor Murakami (reigned 946–967), who was the reigning emperor in the year the story takes place (944 CE). The emperor's newborn son and heir is named 'Atsuhira' (敦平) in the film, which is actually the name of a later emperor (Go-Ichijō, reigned 1016-1036). The historical son and successor of Murakami, Emperor Reizei, was named 'Norihira' (憲平).
Ken'ichi Yajima as Fujiwara no Morosuke (藤原師輔): The Emperor's Minister of the Left. The historical Morosuke was in reality Emperor Murakami's Minister of the Right.
Akira Emoto as Fujiwara no Motokata (藤原元方): The Emperor's Minister of the Right, who, at Dōson's instigation falsely accuses Seimei of cursing the newborn Prince Atsuhira (which was actually Dōson's doing). The historical Motokata had been a Dainagon under Murakami.
Sachiko Kokubu as Tōko (任子): The Emperor's consort and Morosuke's daughter who bears him Prince Atsuhira. Based on the historical Fujiwara no Anshi (aka Yasuko).
Yui Natsukawa as Sukehime (祐姫): Motokata's daughter and one of the Emperor's wives. Her son, Prince Hirohira, was originally supposed to be the heir to the throne; the birth of Atsuhira, however, caused her to be sidelined. She is enamored by Hiromasa's flute playing; Hiromasa, in turn, falls in love with her, unaware of her true identity. Dōson later takes advantage of her jealousy against Tōko and Atsuhira to turn her into an oni.
Masato Hagiwara as Prince Sawara (早良親王 Sawara-shinnō): An imperial prince who died swearing vengeance on the imperial throne 150 years before the story takes place. Dōson seeks to awaken and harness his spirit in order to depose the current emperor.
Hōka Kinoshita as Emperor Kanmu (桓武天皇 Kanmu-tennō): Prince Sawara's elder brother who charged him with treason, driving Sawara to suicide. Fear of Sawara's restless spirit led Kanmu to move the capital from Nagaoka-kyō to Heian-kyō and to pacify Sawara's ghost by sealing it inside a burial mound.
Kyōko Koizumi as Aone (青音): A woman who was Prince Sawara's lover in life. Rendered immortal by consuming the flesh of a mermaid 150 years ago, she was appointed by Kanmu to ensure that Sawara's spirit will never reawaken.
Ken'ichi Ishii as Fujiwara no Kaneie (藤原兼家): A nobleman who finds a gourd growing out of a pine tree in his house, which was actually the manifestation of a curse laid by a jilted lover of his who had killed herself.
Kenji Yamaki as Tachibana no Ukon (橘右近): Captain of the imperial police force, the Kebiishi (検非違使), who arrests Seimei. He is later seen fighting his men who have been possessed by spirits summoned by Dōson.
Hitomi Tachihara as Ayako (綾子): Another one of the Emperor's wives worried that he is spending more time with Tōko.
Ni'ichi Shinhashi as Nagamasa (長正)
Kenjirō Ishimaru as Kanmu's head onmyōji
Masane Tsukayama as Narrator
Terrence Stone: Abe no Seimei
Brandon Jones: Minamoto no Hiromasa
Steve Kramer: Dōson
Simon Prescott: Emperor
Richard Cansino: Fujiwara no Morosuke
Tom Wyner: Fujiwara no Motokata
Helen Storm: Tōko
Mona Marshall: Sukehime
Tony Oliver: Prince Sawara
Kari Wahlgren: Aone
Bob Papenbrook: Tachibana no Ukon
Jim Taggert: Nagamasa
Onmyōji was released theatrically in Japan on October 6, 2001 where it was distributed by Toho. The film was a commercial success grossing ¥3,010,000,000 ($36,567,313) becoming the 4th highest earning Japanese production of 2001. The film was also giving a limited theater release in North America where it grossed $16,234 in 3 theaters.
It was released in the United States on April 18, 2003 under the title Onmyoji - The Yin Yang Master. It was followed by the sequel Onmyoji II in 2003.
The film won the awards for Best Sound Recording and the Mainichi Film Concours and Best Sound at the Japanese Academy Awards.