The Boston and Providence Railroad was a railroad company in the states of Massachusetts and Rhode Island which connected its namesake cities. It opened in two sections in 1834 and 1835 - one of the first rail lines in the United States - with a more direct route into Providence built in 1847. Branches were built to Dedham in 1834, Stoughton in 1845, and North Attleboro in 1871. It was acquired by the Old Colony Railroad in 1888, which in turn was leased by the New Haven Railroad in 1893. The line became the New Haven's primary mainline to Boston; it was realigned in Boston in 1899 during the construction of South Station, and in Pawtucket and Central Falls in 1916 for grade crossing elimination.