In 1845, the projected York & Hull East & West Junction Railway made an offer to purchase the canal, and the chairman of the Pocklington company, who was associated with the York and North Midland Railway, made a counter offer for the same amount on behalf of his railway. The canal company accepted both offers, on the basis that the first railway to be authorised by an Act of Parliament could then buy the canal. The York and North Midland obtained its Act in 1846, and opened a line in October 1847 which linked Beverley, Market Weighton, Pocklington and York. They obtained another Act that year, which authorised them to buy the canal, as well as the Market Weighton Canal, the Leven Canal and Vavasour's Canal. The total cost to the railway for the canal was £17,980, of which £4,587 was paid in cash and went to the smaller shareholders, while the rest was paid to the larger shareholders as debentures. The purchase was completed on 18 November 1848, and the railway had an obligation to keep the canal open. The Railway Commissioners could intervene if they failed to maintain the canal.