Starting in the Silla Dynasty (57 BC – 935 AD) and then during the Goryeo Dynasty (AD 918–1392), Buddhism was the state religion and eating beef was considered immoral and was at first discouraged and then banned (cows were regarded as human work companions). In general, animal life was regarded as sacred and eating meat was minimized; however, eating seafood remained common. During the latter part of the Goryeo Dynasty, the practice of eating dog meat was introduced by the nomadic Khitans, who as war refugees spilled into Goryeo during the Mongol invasions. The invading Mongols lifted the beef ban and legalized the consumption of meat during their rule. During the Joseon Dynasty (AD 1392–1910), the minority Khitans eventually assimilated into the social structure as the "Baekjeong," the first butcher class, occupying the lowest class of society. The Joseon government assigned the Baekjeong the task of addressing the feral dog problem, and thus dog meat became a food item for the poor (and lower classes). During the Joseon Dynasty, certain government officials argued that dogs were human companions and wanted to ban the consumption of dog meat.