Lafayette is located in southeastern Boulder County at It is bordered by the town of Erie to the north and east, by the city of Broomfield to the east and south, and by Louisville to the southwest. U.S. Highway 287 is the main road through the city, leading north to Longmont and south to Broomfield and Denver. State Highway 7 leads east from Lafayette to Brighton and west to Boulder.(39.995, -105.100556).
According to the United States Census Bureau, Lafayette has a total area of 9.6 square miles (24.9 km2), of which 9.5 square miles (24.5 km2) is land and 0.15 square miles (0.4 km2), or 1.50%, is water.
Lafayette was founded in 1888 by Mary E. (Foote) Miller. She and her husband, Lafayette Miller, had moved to the area to farm land they had purchased from Denver coal speculators Francis P. Heatly and Edward Chase. The farm also included land acquired by Mary's brother, James B. Foote and father, John B. Foote via the Homestead Act in 1871. In 1874 the Millers moved to Boulder. Lafayette Miller ran a butcher shop and was a town trustee. Lafayette Miller died in Boulder in 1878, after which Mary Miller moved back to the farm with their six small children. In 1884 coal was discovered on the Miller farm, and in 1887 John H. Simpson acquired a coal lease from James B. Foote and sank the first Simpson Mine shaft, thereby starting the coal mining era. In 1888 Mary Miller designated 37 acres (0.15 km2) of the farm for the town of Lafayette, which she named after her late husband. In July 1888 a second mine, the Cannon, went into operation and the first houses were built. Mary Miller submitted a revised 89 acres (0.36 km2) plat for the town in 1889. Also in early 1889, Mary Miller leased the rights to mine coal for 12.5 cents per ton to Charles Spencer and John H. Simpson. The two commenced sinking the Spencer coal mine 200 yards west of the Simpson coal mine. On April 2, 1889, the town of Lafayette was incorporated. As stipulated in the original property deeds for the platting, no alcohol could be sold or distributed east of what is now known as Public Road. In 1904, the Lafayette Town Board mandated that the "alcohol clause" be added to all platted additions to Lafayette. "Alcohol clause" deed restrictions weren't repealed by the City of Lafayette until the 1980s.
Lafayette quickly became a part of the coal-mining boom that all of eastern Boulder and southwestern Weld counties were experiencing, with the combined Spencer/Simpson mine being the largest and most productive. The Cannon floundered and failed to produce profitable quantities of coal. It closed in 1898. By 1914 Lafayette was a booming town with two banks and four hotels. Lafayette was also the location of one of the nation's first distributed electrical grids powered by the Interurban Power Plant that served Louisville, Boulder, Longmont, and Fort Collins.
Mary Miller continued to be a leader in the community, especially in January 1900, when the town's business district burned. She founded the Farmers’ & Miners’ State Bank with S.T. Hooper, C.C. Brown and G.C. Beaman in June 1892, which closed in August 1894. Mary Miller then formed the Lafayette Bank in 1900. She was elected president of the bank, and according to a Denver Post article reprinted in the Lafayette News and dated Dec. 13, 1902, was "the only woman in the United States known to be president of a bank." The bank closed in 1914 because of roughly $90,000 in bad loans to the striking United Mine Workers. Mary Miller remained devoted to the temperance movement and eventually ran on the 1913 Prohibition Party ticket for the U.S. Senate seat won by Gov. John F. Shafroth. She also ran for the state treasurer seat on the Prohibition Party ticket. Miller died in 1921 at her daughter-in-law's home at 501 E. Cleveland Street.