In 1872, The Pittsburgh and Castle Shannon Railroad line was completed, providing a direct link from Pittsburgh to what was then known as the Village of Castle Shannon. Development was stimulated by two years of free transportation and lumber transport given to anybody building a home.. In 1877, a second railroad was built from Finleyville through Castle Shannon to the West End of Pittsburgh. In 1909, the right of way through the valley containing Castle Shannon was purchased by Pittsburgh Railroad. This helped lead to Castle Shannon becoming a center for coal mining, with 8 mines in operation in 1904. The Pittsburgh and West Virginia Railroad, still active today, came shortly after.
The First National Bank in Castle Shannon was the site of a much publicized bank robbery in 1917. $18,500 was taken in the robbery, of which $10,500 was immediately recovered from one man shot during the escape. The full sum was never recovered.
Castle Shannon was incorporated as a borough in 1919, formed from parts of Baldwin Township, Mt. Lebanon, and Bethel Township.
There were 3,859 households out of which 23.2% had children under the age of 18 living with them, 45.3% were married couples living together, 10.7% had a female householder with no husband present, and 40.7% were non-families. 35.1% of all households were made up of individuals and 12.5% had someone living alone who was 65 years of age or older. The average household size was 2.20 and the average family size was 2.88.
In the borough the population was spread out with 19.7% under the age of 18, 7.3% from 18 to 24, 32.9% from 25 to 44, 21.4% from 45 to 64, and 18.7% who were 65 years of age or older. The median age was 39 years. For every 100 females there were 90.0 males. For every 100 females age 18 and over, there were 85.5 males.
The median income for a household in the borough was $38,040, and the median income for a family was $48,586. Males had a median income of $33,013 versus $27,907 for females. The per capita income for the borough was $20,518. About 5.0% of families and 7.7% of the population were below the poverty line, including 9.4% of those under age 18 and 7.8% of those age 65 or over.