Hitobashira, the human pillar
Hitobashira, or human pillar, is the Japanese legend that people were buried or drowned to make an embankment, bridge or castle hold. The stories attach to real places such as Matsue and Maruoka castles.
The oldest story in the sources is in the Nihon Shoki of 720, in W. G. Aston's translation, in the book on Emperor Nintoku. Two men were sought out and sacrificed to the River-God so that the gaps in an embankment could be closed. One, Koha-kubi, wept and threw himself into the water, and the embankment was finished. The other, Koromo no ko, stood over the stream with two calabashes, pushed them into the water and prayed to the River-God.
Lafcadio Hearn recorded two stories in 1894. In the first, which he introduces as something related, a young woman of Matsue was buried alive under the castle walls as it was built, as an offering to gods nobody now remembers. Hearn says her name was never written down, and people recall only her beauty and her love of dancing. He compared the tale to the Serbian ballad "The Foundation of Skadra". In the second, it was agreed that the first man to cross a bridge in hakama lacking a machi would be placed beneath it. That man was Gensuke of Saikamachi, and Hearn says the middle pillar carried his name for three hundred years.
Wikipedia says Maruoka Castle, one of Japan's oldest castles still standing, is rumoured to rest on a human pillar, through a story known as the O-shizu legend. The sources here record no burial found at any of these sites.
"Let these two men be sacrificed to the River-God, and thou wilt surely be enabled to close the gaps." So he sought for these two men, and having found them, sacrificed them to the River-God. Hereupon Koha-kubi wept and lamented, and plunging into the water, died. So that embankment was completed. Koromo no ko, however, took two whole calabashes, and standing over the water which could not be dammed, plunged the two calabashes into the mid-stream and prayed, saying:—"O thou River-God, who hast sent the curse (to remove which) I have now come hither as a sacrifice."
- Glimpses of Unfamiliar Japan, First Series, ch. 7 'The Chief City of the Province of the Gods' (Matsue Castle maiden), Lafcadio Hearn (1894), Project Gutenberg
- Hitobashira, Wikipedia