The Portpatrick Railway gave ready access from Portpatrick and Stranraer to Dumfries and English locations, but connection from the City of Glasgow was ill-served. On 5 July 1865 an Act authorising the Girvan and Portpatrick Junction Railway (G&PJR) received the Royal Assent; it would join with existing routes via Ayr, and connect in to the PPR at Challoch Junction, about 6½ miles (10½ km) east of Stranraer. At first this was treated amicably by the PPR as it would shoulder a share of the costs of the port facilities at Stranraer and bring in mileage fees for the through running, but when the G&PJR agreed with the G&SWR to work its line, the Caledonian Railway, working the PPR line, became defensive. The G&PJR started public operation on 5 October 1877 in the face of CR obstruction.