To satisfy the city?s demand for coal, a company was formed to build a railway into Bristol from Coalpit Heath, a mining area to the north-east. Its Act of Parliament received Royal Assent on 19th June 1828, authorising what was formally known as the Bristol & Gloucestershire Railway (B&GlosR). W H Townsend surveyed the route and held the post of engineer. The intention from the outset was for two tracks, but only one was laid initially.
Financial constraints resulted in the line being progressed in two phases, with the northern part - from Mangotsfield to Coalpit Heath - opening in July 1832. A second Parliamentary Act in 1834 allowed funds to be raised for the southern section, the completion of which was marked by the passage of a train on 30th July 1835. Drawn by a horse, it was made up of eight wagons with the leading one occupied by a band. Thousands lined the route, having previously seen nothing like it. The total cost of the line was ?77,000.
In February 1834, the contract was put out to tender for a 518-yard tunnel under Staple Hill, west of Mangotsfield. It measured 12 feet wide and 16? feet high. Reports suggest it was driven from three shafts - all of which were retained for light and ventilation - but, today, only two shafts are open in the tunnel, 174 and 341 yards from the eastern end.