Beer originated in ancient Mesopotamia over 10,000 years ago, though the earliest written record of beer brewing comes from ancient Egypt around 5,000 BC. The Egyptians used beer for religious ceremonies and the Pharaohs directed brewing and distribution. Beer is made through a process of milling grain to extract sugars, mashing to convert starches, separating wort from grains, boiling wort with hops, cooling and fermenting wort with yeast to produce alcohol and flavors. Beer has since become known as the "Champagne of beers" and plays a role in social gatherings in pubs.