According to the "Nenjugyojihisyo (descriptions of annual events)" the custom came from China and originated in a legend that, by offering red bean Kayu to Chihyu (a god of Chinese myth) or a woman ghost of the Koshin clan, then eating it, people could escape their curses and avoid evil spirits throughout the year.
起源は、『年中行事秘抄』によれば、中国からつたえられたので、この日にあずき粥を蚩尤もしくは高辛氏の女の怨霊に供し、これを食すればその祟りをのがれ、年中の邪気をはらうという伝説に由来するという。