It was opened in parts: the first section connecting Shepton Mallet to Witham, later extended to Wells, was built by the East Somerset Railway from 1858.
Important inland market towns suddenly found themselves at a huge disadvantage when trunk railways connected competing communities, giving them cheap and fast transport of the necessities of life, and of their products.
The Wilts, Somerset and Weymouth Railway (WS&WR) obtained its authorising Act of Parliament on 30 June 1845, to build from the GWR main line near Chippenham, to Salisbury and to Weymouth, the latter part running through Frome, Witham and Castle Cary towards Yeovil.
Isambard Kingdom Brunel was retained as the little company's engineer, and after a survey he recommended that Witham would be a preferable point of junction, reducing construction costs.
The City of Wells had anticipated a rail connection from the Somerset Central Railway, which had opened from Glastonbury to Highbridge in 1854; the Somerset Central main line was to have passed through the City, but the railway's priorities had changed and even a branch connection was much delayed.
They would, and nearly all of the promised subscription was quickly forthcoming; the ESR obtained an Act on 25 July 1857 extending their powers to reach Wells, and authorising an additional £40,000 capital.
[3] Contract had been let to Brotherhood for the construction of the Shepton Mallet section early in 1857 and in October 1858 Captain Yolland of the Board of Trade visited the line for the formal inspection prior to opening for passengers.
However the implacable opposition of a landowner made adherence to the route originally designed impracticable, and a deviation to avoid his residence was planned; this was authorised by another Act of 14 June 1860.
The Somerset Central was taking steps to become independent of the B&ER, mixing the gauge of its track and acquiring its own rolling stock.
The Somerset Central had intended making a branch from Wells to Yatton, joining the B&ER main line there, and including the formation of the direct connection to the East Somerset line at Wells, and a spur there to enable direct running from Glastonbury to Bristol.
The Board of Trade made it clear that the proposed through line was not acceptable, and the B&ER had to construct a separate station at Wells on Tucker Street, short of the S&DR.
"[11] In fact in 1874 when the B&ER Yatton line was still broad but the GWR former ESR line was narrow, an exchange platform was built by the B&ER at the East Somerset station, but sanction to run passenger trains through was again refused by Colonel Yolland; this was partly due to anticipated blockage of the turnpike road (Priory Road) by ESR engines running round their trains.
Yolland reported that Great pains [had] been taken to make such arrangements of the sidings points and their connections with the signals by interlocking as to provide against the danger inherent on crossing so many goods lines on the level, but ... these arrangements are not suitable for working the passenger trains through Wells, as a through station ... [nor do I] assent to the present construction of this station so far as it renders it necessary to shunt engines across the turnpike road.
[12]Gauge conversion on the B&ER line in November 1875 and operation of through trains of course reduced the blockage of the road by engines of terminating trains running round; the remaining sidings that did not have trap points must have been fitted, for the Board of Trade objection to through running was eventually resolved, and the intended connection was opened on 1 January 1878.
As it was the terminus of that railway's branch from Glastonbury and Street, so that terminating trains blocked the through line during their own station duties there.
The entire route from Yatton to Witham was now under single ownership, although it relied on running over 9 chains (180 m) of the Somerset and Dorset Joint Railway.
Blagdon and Farrington Gurney had long wanted a railway connection, but local interests could not raise the necessary funds.
The line was 6 miles 41 chains (10.5 km) long and the station at Congresbury was substantially altered to accommodate the junction.
A new section of path along the top of the Congresbury Yeo river bank avoids the busy A370 road running alongside.
Upon reaching the rail bridge on the outskirts of Sandford the trail joins Nye Road for about half a mile (800 m), before turning right into a new off-road link.
There is a view of the station, goods shed and platform including a short section of track, with period carriage and open wagons.
The scenery through to Winscombe changes from open moorland to railway cuttings, with the path in condition to match the previous sections.
After the tunnel the line continues due south through a deep cutting and onto an embankment as the land falls away until meeting the A38 which a bridge once crossed.
[21] From this point the line turns eastwards and follows the southern edge of the Mendip Hills crossing the Cheddar Yeo.
The railway track is regained opposite St Michael's Cheshire Home and there is a picnic spot overlooking the reservoir.
The route comes to an end at the side of the former station which is now in use as a stonemason's surrounded by a small industrial estate, a mile (1.6 km) from Cheddar Gorge.
[25] Proposals to restore a passenger service from the Heart of Wessex Line at Witham to Shepton Mallet are endorsed by Mendip District Council[26] and Wells MP James Heappey.