The ancient Egyptians built pyramids as tombs for the pharaohs and their queens. The pharaohs were buried in pyramids of different sizes from before the beginning of the Old Kingdom to the end of the Middle Kingdom.