Āṭavaka (Sanskrit; Pali: Ālavaka) is a popular figure in Buddhism. He is a yakṣa and regarded as a Wisdom King in esoteric tradition.

At the time of the Buddha, Āṭavaka was a man-eating yakṣa that lived deep in the forest of ĀṭavI. One day, the king of Āṭavī was hunting in the forest. On his way back to the palace, he passed under a large banyan tree where Āṭavaka dwelt. The yakṣa was granted permission by King Vaiśravaṇa that he could seize and devour anyone who came within the shadow of his abode. In exchange for his life, the king, along with his ministers and the mayor Nagaraguttika, made a promise to provide the demon with the bodies of captured criminals as food.

Of Āṭavaka's many powers, one was that a glance at him could make one's body as soft as butter. It eventually came to pass that due to a shortage of criminals, each household in the vicinity was forced to sacrifice one child to satiate the demon. Pregnant women fled the capital until twelve years later, the only child left was the king's own son Āṭavaka Kumāra. The king dressed his son for the occasion of sacrifice. The Buddha, using his power of clairvoyance, saw the potential outcome of the situation and hastened to the yakṣa's lair.

While Āṭavaka was away with an assembly of yakṣas in the Himalayas, the Buddha was greeted by his doorkeeper Gadrabha. Gadrabha warned the Buddha of the demon's wrathful nature, but the Buddha fearlessly entered Āṭavaka's abode and sat upon his throne.

Gadrabha traveled to the Himalayas to inform Āṭavaka what had happened. Meanwhile, the Buddha was teaching Dharma to Āṭavaka's womenfolk. The yakṣas Śatagiri and Haimavata were also on their way to the assembly in the Himalayas and became aware of the Buddha's presence by their inability to fly directly over him. They flew down to venerate the Buddha before continuing on their journey.

When Āṭavaka heard from Gadrabha, Śatagiri and Haimavata of the Buddha's presence, he placed his left foot on Manosilātala and his right foot on Kelāsakūta, both localities in the Himalayas, which suggests that the yakṣa grew to an enormous size. He cried out his name aloud and hurried back to his palace. Despite his various supernormal powers, he was unsuccessful as dislodging the Buddha from his throne. Even his ultimate weapon; the cloth Dussāvudha, one of the four most powerful weapons in the world; was of no effect. When he hurled it, it simply fell at the Buddha's feet as a rug.

Āṭavaka finally asked the Buddha to leave. The Buddha complied. The demon then summoned him to return, which the Buddha did. To and fro the Buddha went at Āṭavaka's command until the fourth time, when the Buddha refused to obey.

Āṭavaka's proposed a set of questions to the Buddha, claiming that if he was unable to answer, he would possess his mind, rip out his heart, or hurl him by the feet across the Ganges river. Although there are a total of thirteen questions, they are usually grouped together as eight. In question and answer format, these are as follows:

Convinced of the arhats’ Dharma for attaining unbinding,—heedful, observant—one listening well gains discernment.

Doing what’s fitting, enduring burdens, one with initiative finds wealth.

13) Passing from this world to the next world, how does one not grieve?

Endowed with these four qualities,—truth, self-control, stamina, relinquishment (cāga)—a householder of conviction, on passing away, doesn’t grieve.[3]

After his questions were answered, the yakṣa, amazed at the Buddha's wisdom and righteousness, became a śrotāpanna. The Commentary (SnA.i.228) states that Āṭavaka's parents had prepared these questions and their answers from Kāśyapa Buddha and taught them to their son. He had them written on a gold leaf with red paint to be stored in his palace. The answers the Buddha gave were identical to those given by Kāśyapa Buddha.

At dawn, the king's men arrived with the young prince prepared for sacrifice as food for Āṭavaka. They hear the yakṣa shout with joy upon hearing the Buddha's teachings. When they offered the boy to the demon who in turn handed him over to the Buddha. The Buddha blessed the boy and handed him back to the king's men. This boy was then known as Hastaka Āṭavaka, who became one of the foremost lay disciples of the Buddha.

Upon learning of the demon's conversion, the king and the citizens of Āṭavī built for him a special residence near that of Vaiśravaṇa, where they provided him with gifts of flowers, scents, and more.

The Mahāyāna tradition recognizes Āṭavaka as a Wisdom King and one of the Eight Great Yakṣa Generals of Vaiśravaṇa. A common title is Āṭavaka Mahāyakṣasenāpati (Sanskrit; lit. “Great Yakṣa General Āṭavaka”).

In East Asia, he is commonly known as 大元帥明王 (Chinese:Dàyuánshuài Míngwáng; Japanese: Daigensui Myōō; lit. "Generalissimo Wisdom King"), though many other names and translations exist.

Images of Āṭavaka vary, but he is commonly depicted with one head and four arms, four heads and eight arms, six heads and eight arms, eighteen heads and thirty six arms, etc. He is often blue, black or red in color and wields a sword, vajra, and other items. He has a countenance of wrath and a body enveloped by flame, which is common to other Wisdom Kings. He is sometimes seen with Nāgas encircling his arms and legs.[4]

Daigensui Myōō is venerated as a protector of the nation from foreign enemies as well as natural disasters. In ancient times, the Japanese Imperial Court held a ceremony from the eighth to fourteenth days of the first month called Daigensui no hō (大元帥の法; lit. Law of Āṭavaka) to ward off calamities.[5]

Below is a non-exhaustive list of temples and shrines at which Daigensui Myōō is enshrined:

Several esoteric practices fall under Āṭavaka's jurisdiction and include several mantras and dhāraṇīs. Some are as follows:

The Āṭavaka Dhāraṇī Sūtra (T. 1238) contains several more dhāraṇīs as well as several seals (印, pinyin: yìn) and talismans (符, pinyin: ) that serve different purposes.

The shout Āṭavaka cried before facing the Buddha is held by tradition to be one of the four shout heard throughout Jambudvīpa. His weapon, the Dussāvudha, is also known as one of the four most powerful weapons in the world. The others are

He is also listed among the yakṣas in the Atānātiya Sutta to be called upon by Buddhists for protection.

Professor Kaigyoku Watanabe has identified the story of Āṭavaka as among the class of Kalmāsapāda stories, in which three main themes are central: