Lunenburg was first settled in 1718 and was officially incorporated in 1728. The name stems from one of the titles of King George II of Great Britain, Duke of Brunswick-Lüneburg. During King Georges War, natives raided the village and took settlers captive to Quebec. Areas of neighboring Fitchburg were once part of Lunenburg, but broke away around this time because the walking distance to church and town meetings was too great for many. Closed in 2000, Whalom Park on Whalom Lake was a famous amusement park in Lunenburg. It closed with the rising popularity of Six Flags New England in Agawam. It was home of the famous Flyer Comet, now demolished.
According to the United States Census Bureau, the town has a total area of 27.7 square miles (72 km), of which 26.4 square miles (68 km) is land and 1.3 square miles (3.4 km), or 4.59%, is water.
Lunenburg is bordered by Townsend to the north, Shirley to the east, Lancaster to the southeast, Leominster to the south, Fitchburg to the west, and Ashby to the northwest.