In the Bible, a scapegoat is one of a pair of kid goats that is released into the wilderness, taking with it all sins and impurities, while the other is sacrificed. The concept first appears in the Book of Leviticus, in which a goat is designated to be cast into the desert to carry away the sins of the community.
Then Aaron shall lay both his hands on the head of the live goat, and confess over it all the iniquities of the people of Israel, and all their transgressions, all their sins, putting them on the head of the goat, and sending it away into the wilderness by means of someone designated for the task. The goat shall bear on itself all their iniquities to a barren region; and the goat shall be set free in the wilderness.
Practices with some similarities to the scapegoat ritual also appear in Ancient Greece and Ebla.