This location is out of use. The junction was immediately south of Millerhill station (1849). It was the junction between the Edinburgh and Hawick Railway (North British Railway) of 1847 and the Edinburgh, Loanhead and Roslin Railway of 1874. (The 1831 Edinburgh and Dalkeith Railway alignment was off to the west.)
The signal box was in the 'V' of the junction. It opened the year before the Loanhead line opened.
Sidings were laid on the west side of the station (the goods yard and for the Edmonstone Iron Works and a bay platform. These could be accessed from the branch and a connection was also laid allowing access from the mainline to the south. The goods yard had originally been on the west side and this connection allowed continued use of the sidings. To the south on the main line was a branch to the Edmonstone Colliery Wellington Pit and [Edmonstone Colliery Waterloo Pit]] off to the east and Edmonstone Colliery Engine Pit to the north, with sidings on the main line.
The junction was remodelled several times but the biggest change came with the opening of the Millerhill Marshalling Yard (British Railways) in 1962. For this the signal box was replaced by Millerhill Power Box at the north end of the yard.
On the west side of the main line were laid out the Millerhill Yard Carlisle Arrival Sidings (these were an expansion and remodelling of existing sidings here, laid out by the main line in the 'V' of the junction from which they were approached). After the alteration these sidings were looped at their southern end. Despite the name in practice these were used for northbound/down trains arriving from the East Coast Main Line from Monktonhall Junction, allowing these to be rounded and drawn north to the Millerhill Yard Down Arrival Sidings. Trains from Carlisle were able to directly enter the Millerhill Yard Down Arrival Sidings from the south.
Further arrival sidings were laid on the west side of the Loanhead route. There was also a sand drag for runaways.
Both sets of arrival sidings were continued north on the west side of the main line to the Millerhill Yard Down Arrival Sidings, occupying the site of the former bay platform and sidings.
With this remodelling this also became the junction for the lines north into Monktonhall Colliery. These ran north from the west side of the former station and south to both the Millerhill Yard Carlisle Arrival Sidings and Loanhead arrival sidings. This new trackworks was accommodated by both removal of the station platforms (the station closed in 1955) and the building of a new long road bridge.
Confusingly Millerhill South Junction is to the north, the southern end of the triangle of lines at the south end of the up yard. The eastern end of this triangle, Millerhill East Junction, leads to Monktonhall Junction on the East Coast Main Line.
The line south of the junction closed in 1972, except for several sidings, the Royal Scotsman depot and East Coast Main Line electrification depot. The former Millerhill Yard Carlisle Arrival Sidings were used for loaded coal trains from Monktonhall Colliery to round and run to Cockenzie Power Station.
The Loanhead route survived to serve Bilston Glen Colliery and after its closure was retained as a loop at the south end of the yard.
The former main line and arrival sidings to the south is now entirely lifted, the Loanhead route loop remains, out of use.