I recently came across references to a practice known as “foundation sacrifice.” In many societies historically, a person would be built into a bridge, buried underneath a new road, or sealed into the foundation of an important building. Human sacrifice created a “ghostly guardian” for the structure or placated a nearby deity angered by the construction–like a river spirit in the case of a bridge. There are Old Testament references, Bulgarian folk songs, and Fijian accounts of these practices. In Hampi (South India), one pre-modern ruler was said to have buried his pregnant daughter beneath a wall to prevent it from falling down, as it had done more than once before.
The history of religion, engineering and law intersect in murder trials from colonial Burma. In one case from 1919, a villager in the southern Shan States was tried for the murder of a monastery servant. The villager admitted that he had done the killing, but in self-defense. Reflecting the practice known in Burma as myosade, the monastery servant had threatened to have the accused “offered to the Bridge Spirit.”
For more, see G. E. Harvey, History of Burma (London: Frank Cass & Co., 1967), 320-1; Paul G. Brewster, “The Foundation Sacrifice Motif in Legend, Folksong, Game, and Dance,” Zeitschrift fuer Ethnologie Bd.96, H.1 (1971), 71-89.