Canadian heavy oil is the weakest in almost five years, leading Canada’s largest producer to focus on drilling for lighter crude.

Western Canadian Select’s discount to benchmark West Texas Intermediate widened 20 cents to US$31 a barrel Friday, the biggest gap since December 2013, data compiled by Bloomberg show. Prices have tumbled amid constraints on pipeline and rail capacity out of Western Canada and as the U.S. Midwest’s biggest refinery prepares for maintenance later this month on its largest crude distillation unit.

Canadian Natural Resources Ltd. announced Thursday it was curtailing heavy oil drilling and shifting capital to production of lighter oil. The company drilled 39 primary heavy wells in the second quarter versus 63 originally planned, executives said in its second-quarter earnings call. While it plans to cut back heavy oil exploration further in the second half of the year, it will drill an additional seven light-oil wells, Canadian Natural said earlier in its earnings release.

Prices came under pressure in July as the shutdown of the Syncrude oil-sands upgrader increased the supply of heavy crude. Enbridge Inc. apportioned 47 per cent of space on its heavy-oil lines in August, little changed from July. Canadian rail companies, while increasing crude exports to a record of almost 200,000 barrels a day in May, have nonetheless lagged in ramping up the transport of excess production, Corey Bieber, Canadian Natural’s chief financial officer, said in the company’s second-quarter earnings conference call.

“We keep hearing that more rail is coming and it has obviously been slower,” he said.

BP Plc’s Whiting, Indiana, refinery plans to begin shutting units including its biggest crude distillation unit and largest coker later this month, according to people familiar with the matter. The 414,000 barrel-a-day refinery was revamped to process more heavy Canadian crude.

With the exception of a few companies that can use more conventional means to drill for bitumen, few oil sands producers can cost-effectively curtail production because so much of their costs are largely fixed, Kevin Birn, a director on the North American crude oil markets team at IHS Markit, said in a phone interview.

“If you have an asset where letting it decline doesn’t affect operating costs, you let that happen until things normalize,” he said. “For most of the big oil sands facilities, its harder to do that because a reduction in output increases costs per unit.”