The town was first mentioned in written sources in 1744, but began growing a century later when a large postal station was established on the Kaunas–Suwałki road, part of a longer Berlin – St. Petersburg route, in 1838–1839. Mail coaches would stop here to change horses and pick up passengers. The office was closed after the postal route was superseded by the Warsaw – Saint Petersburg Railway, built in 1859–1861. During the Uprising of 1863, a battle occurred between local rebels (some 620 men) and Russians army on August 21, 1863. Poorly armed rebels were defeated and lost about 80 men before retreating. After establishment of the teachers' seminary, Veiveriai grew as a center of education and culture. In the 1930s, during an economic crisis, the town was part of fierce protests against the government of Antanas Smetona. Two protesters were killed. After World War II, Veiveriai supported armed anti-Soviet resistance. In 1989 "Skausmo kalnelis" (Hill of Sorrows) was created where bodies of killed resistance fighters were buried. The hill was incorporated into the town's coat of arms, adopted in 2004.