It all started with the Andover & Wilmington Railroad in 1833. Connecting its namesake cities within a few years, Andover was now connected to the City of Boston by way of the Boston & Lowell Railroad. With extensions to the north towards Portland, Maine, the railroad reached Haverhill in 1837 and then the New Hampshire state line in 1840. In New Hampshire, the Boston & Maine Railroad was chartered to continue the trek to Portland within the Granite State. In 1842 the Boston & Portland Railroad (formerly the Andover & Wilmington) in Massachusetts and the Boston & Maine Railroad in New Hampshire merged, with the new entity keeping the Boston & Maine name. Through construction, leases, and acquisitions the Boston & Maine grew, with the final major addition being the lease of the Fitchburg Railroad in 1900. The Boston & Maine served northern New England until 1983 when it was purchased by Guilford Transportation Industries.
New Hampshire rail lines in bold