An oil boom in North Dakota has brought a flood of workers, infrastructure investment and tax revenues.

But as production soared, it became increasingly difficult to move oil out of the region as pipeline capacity lagged behind.

Enter trains.

The railroads that helped settle the American West more than a century ago are now helping to fuel a new frontier: oil shale production that has reshaped western North Dakota.

Analysts and those doing business in the Bakken say there wasn’t enough existing pipeline infrastructure to handle the rapid increases in crude oil being pumped out of the ground, forcing companies to find other ways to move it across the country. Since then, they are finding that trains have advantages over shipping by pipelines, despite its higher cost.

The transportation shift was swift and drastic. Pipeline transported 74 percent of the oil coming from the Williston Basin in January 2007, as advances in hydraulic fracturing and horizontal drilling began unlocking vast amounts of crude oil from underneath North Dakota.

Rail, on the other hand, transported none of that newly accessed crude.

Last November, rail shipped 71 percent – nearly 800,000 barrels of oil a day – of the basin’s oil, while pipelines shipped just 22 percent, according to estimates from the North Dakota Pipeline Authority. Meanwhile, the number of railcars carrying crude oil on major freight railroads in the U.S. is projected to have grown by more than 6,000 percent between 2007 and 2013, according to the Association of American Railroads.

But that rapid increase also comes as several recent high-profile wrecks have prompted the attention of lawmakers and federal regulators. The closest of those was in Casselton, N.D., about 20 miles west of Fargo, where more than a dozen tank cars derailed in December, prompting the evacuation of the small town after explosions and smoke darkened the sky. That came about two months after another train derailed in Alabama, and after a far more tragic crash in Quebec last summer killed 47 people.

Industry officials are hesitant to link increased crude-by-rail shipments to more spills, and point out that such crashes are extremely rare. And most say trains will continue to have a role in crude oil transportation in what is now the nation’s second-leading oil producing state.

Seeking certainty

By the end of 2007, oil companies could move 230,000 barrels per day by pipeline out of the Williston Basin – which includes western North Dakota, eastern Montana and part of South Dakota – or to North Dakota’s only refinery, the Tesoro facility in Mandan. At the time, wells in the region were producing almost as much as that.

But production in the basin soared rapidly – largely in North Dakota – to more than a million barrels per day this past September. By the end of 2013, pipelines and the refinery could handle about 583,000 barrels per day, or about 60 percent, according to estimates from the North Dakota Pipeline Authority.

“Building pipelines requires some certainty,” said Steve Magness, managing director of Bakken Oil Express, a rail loading facility near Dickinson, N.D. “And not everybody was just that certain that hydraulic fracturing and horizontal drilling and all that stuff was really going to work as well as it has. And so there was a lot of hesitancy to invest large amount of money in pipelines and gathering systems until everybody knew that it would work.”

In the meantime, trains have filled in.

According to the pipeline authority, the state’s rail export capacity was 30,000 barrels per day at the end of 2008. That capacity grew to 965,000 barrels per day at the end of 2013.

Adding new pipelines can be more cumbersome than adding crude oil unit trains to existing tracks, analysts said. Constructing new infrastructure, whether it’s pipelines or rail lines, can involve negotiating with individual landowners in order to acquire right of way, said John Duff, an analyst at the Energy Information Administration.

“And that can be a nightmare,” he said. “(Rail) already did this exercise.”

Still, pipeline and refinery capacity in the Williston Basin is expected to reach almost 1.2 million barrels per day by 2016, according to the pipeline authority. That estimate includes the long-delayed Keystone XL pipeline, which North Dakota lawmakers have pushed for in the wake of the Casselton train derailment but still awaits the Obama administration’s approval.

Pipelines remain the dominant form of moving crude oil across the country. In 2012, 7.5 billion barrels of crude oil were transported by interstate pipelines, according to John Stoody, a spokesman for the Association of Oil Pipelines, compared to the 286 million barrels that is projected to have moved by rail in 2013.

‘A bright spot’

The recent crude oil phenomenon has been a boost for railroads, even if the commodity represents a relatively small portion of the industry’s total haul.

“It’s the type of revenue that any company would like to have,” said Barton Jennings, a professor of supply chain management at Western Illinois University and a member of the National Railway Historical Society. “It’s not revenue they thought would be there.”

BNSF’s revenues grew from $14 billion in 2009 to almost $21 billion in 2012, though it’s not clear exactly how much crude oil had to do with that increase. Crude oil only accounts for 4 percent of the total network volume for BNSF, the largest railroad operator in North Dakota, according to company spokeswoman Amy McBeth.

Graham Brisben, CEO of PLG Consulting in Chicago, said rail shipments usually correlate along the nation’s gross domestic product. So in the early years of the recession, when GDP declined, so did rail shipments before rebounding in the past few years, according to the AAR.

Crude oil and sand used in the hydraulic fracturing process have provided some positive news for the rail industry in the midst of declining coal shipments.

“For the railroad industry, it’s been a bright spot,” Brisben said.

Companies like BNSF have made significant infrastructure investments to accommodate the newfound business. In North Dakota alone, it has spent $540 million over the past four years, and its Williston Basin oil transport capacity reached 1 million barrels per day in 2012.

“These investments across the state strengthen our privately funded rail infrastructure and not only make it safer, they also enable BNSF to support the state’s growing freight traffic for all industries and we plan to continue investing just as aggressively in 2014,” McBeth wrote in an email.

The enormous increase in crude-by-rail shipments has also kept tank car manufacturers busy. As of September, there were 58,910 tank car orders on backlog, according to Richard Kloster, a consultant at FTR Consulting Group, who guessed “at least half of those cars are sized and spec’d for moving crude oil.”

“And it’s not just North Dakota. It’s also Texas and in particular, the (Canadian) oil sands.”

Indeed, foreign rail shipments in 2012 jumped by about 10,000 – from 1,000 to 11,000 – from the previous year, according to the Institute for Energy Research.

‘Critical’ role

Rail facilities, which receive oil by truck or pipelines before being loaded into tank cars, have sprung up across the Bakken region since the beginning of the oil boom. And unit trains – trains that can be more than 100 cars long and carry one commodity from one origin to one destination – have become increasingly common.

The first unit train facility designed to load crude oil was built by EOG Resources near Stanley, N.D., in 2009. The company loaded 322 unit trains of its own crude and that of other producers in 2012.

Since 2009, about a dozen unit train facilities have popped up on BNSF’s network alone. U.S. Rep. Kevin Cramer, who toured the EOG facility when he was a member of the state’s Public Service Commission, said that’s because of the “ability to move product by rail to the highest bidder."

Enbridge, a pipeline operator, began adding rail facilities in 2012. Its Berthold, N.D., facility can load 80,000 barrels per day.

Katie Haarsager, an Enbridge spokeswoman in North Dakota, said Enbridge is still focused on pipelines. It’s currently planning the 610-mile Sandpiper Pipeline, which will transport up to 225,000 barrels a day from western North Dakota to Clearbrook, Minn., on its way to Superior, Wis.

“Pipeline is where we want to make our long-term investment,” she said. But, she added: “that rail facility that we have in Berthold will always have a very critical place in being able to deliver crude to the U.S.”

Market dynamics

The share of oil being exported out of the Williston Basin by rail had been growing steadily for about two years, until April 2013, when three-fourths of it left by rail. But suddenly, that rate began to decrease, dipping to 61 percent in August.

Meanwhile, shippers turned to pipeline, increasing its share of oil exports from 17 percent in April to 31 percent by August.

What happened last year is an illustration of how prices can quickly affect how crude oil is shipped.

Two of the most popular benchmarks used by crude oil buyers and sellers to help set prices – West Texas Intermediate and Brent – had tracked fairly closely in early years of the Bakken oil boom. But since 2011, WTI has been consistently lower than the Brent benchmark because of increased production and transportation bottlenecks.

Brisben, the PLG analyst, said the original push for rail shipments was aimed at getting oil to the storage hub at Cushing, Okla., where oil is typically traded using the WTI benchmark. Meanwhile, refineries on the coasts taking imported crude are trading using the Brent benchmark or something similar.

“And that’s what caused crude-by-rail to be an activity that really wasn’t about getting the barrels to Cushing, but let’s get them to these other places where we’re going to fetch a higher price,” Brisben said.

And even though rail transportation is more expensive than pipeline – about $6 more expensive per barrel of oil according to a report from the firm Ernst & Young – that heavier price tag will matter less when the difference between the WTI and Brent benchmarks is wide enough. The spread has been as high as $23.

In the case of last summer, the difference between the two benchmarks narrowed to less than $5, and the shift away from rail transportation followed.

Analysts added that trains are the only option to send crude oil from here to the coasts.

“We never will see a pipeline going east to west, pipelines pretty much go north-south, so the only way to get the crude out is by rail,” said Neil Amondson, vice president of NorthStar Transloading, which is constructing a rail terminal that will open this year on the North Dakota side of the state line from Fairview, Mont.

Rail to stay

Even as the industry faces the potential for updated regulations, analysts and lawmakers say trains will have a critical, if not increased role in transporting crude oil.

Lynn Helms, the state’s top oil regulator, said 90 percent of the state’s oil could be transported by rail this year.

“The amount that operators continue to utilize rail in the coming year is still very much dependent on market dynamics,” he said in an emailed statement. “Federal policy could eventually have some effect on shipping methods; however, it is too early at this point to be able to make that determination.”

But even as lawmakers push for changes to make crude oil transportation safer, they acknowledge rail is here to stay.

“We are not going to take crude off the rails anytime in the near future. Or ever,” U.S. Sen. Heidi Heitkamp said. “It's not going to happen.”

“As long as we have a Bakken play, we will have oil on tank cars on the rails.”

John Hageman covers local business and North Dakota politics. He attended the University of Minnesota in the Twin Cities, where he studied journalism and political science, and he previously worked at the Bemidji Pioneer.