Alon USA Energy Inc., the refiner that shut its Bakersfield plant in California two years ago amid high oil prices, won approval to build a rail terminal that will help the state’s refiners acquire supplies from Canada and the U.S. Midcontinent.

The Kern County Board of Supervisors voted unanimously in Bakersfield to approve Alon’s $170 million plan to upgrade units at the refinery to process a wider range of crudes, unload about 150,000 barrels of oil a day from trains and send any crude it doesn’t use by pipeline to other plants in the state.

Alon’s complex will expand California refiners’ access to North American oil sources that they can’t reach by pipeline, including heavy crude from Canada and light oil from North Dakota’s Bakken Shale formation. The project’s approval comes after a year’s worth of environmental reviews, during which groups including San Francisco-based Earthjustice warned the complex would increase pollution and the risk of derailments.

“This is a very significant approval,” Andy Lipow, president of Houston-based energy consultant Lipow Oil Associates LLC, said by telephone, estimating that Alon’s complex, combined with others, may supply 15% of California’s oil demand. “Producers from Wyoming to Colorado to North Dakota will have access to the West Coast market.”

As part of the project, Alon will build a rail loop from a new spur connection off of BNSF Railway Co.’s tracks and install boilers that will allow the complex to unload both light and heavy oils. The company is also planning upgrades at a crude unit, two hydrocrackers and two hydrotreaters. Crude-processing capacity at the plant will remain at 70,000 barrels a day. Construction is expected to take nine months and may be complete in the second half of 2015, Alon said at yesterday’s meeting.

Paul Eisman, Alon’s president and chief executive officer, said in May that the upgraded plant would process light, sweet crude should it restart.

“It could come from the Bakken, could come from Colorado, could come from, I guess, potentially from West Texas,” he said in a conference call with analysts May 2.

California’s oil-by-rail shipments have jumped to a seasonal record as the state’s refiners turn to trains to access surging production from U.S. shale formations. The boom has boosted domestic output to the highest level in 28 years, bringing the nation closer to energy independence.

Alon estimated in March that shipping Bakken oil by rail to Bakersfield would cost $14 a barrel. The North Dakota crude was assessed at a $4.90-a-barrel discount to the U.S. benchmark West Texas Intermediate oil yesterday, data compiled by Bloomberg show.

Alaska North Slope oil, which makes up about 12% of California’s crude slate, was at a $4.15 premium.

The upgraded Bakersfield refinery would be able to send 19,000 barrels of diesel and gasoline a day to nearby Fresno, Calif., by pipeline, displacing fuel sent from refineries in the San Francisco Bay area, Alon said in filings to the county.

The project’s completion may increase Alon’s value by $7 a share, Credit Suisse Group AG analyst Edward Westlake said in an e-mailed research note from New York Sept. 8. The complex would allow the company to create a tax-exempt master limited partnership, “forcing the value of logistics and opening an avenue to value creation for logistics projects,” Westlake said in the note.

Plains All American Pipeline LP plans to start unloading crude from rail cars at its own terminal in Bakersfield by the end of October, the company said in a conference call with analysts Aug. 7. The oil will travel by pipeline to refineries in the San Francisco and Los Angeles areas.

Earthjustice described Alon’s project yesterday as “wrong for Kern County,” saying it will increase emissions and bring “explosive” Bakken oil to an area already overburdened by air pollution.

County supervisors “should be focused on protecting citizens over industry, not closing their eyes and crossing their fingers that nothing catastrophic befalls the communities in the paths of these oil trains,” Wendy Park, an attorney for the group who spoke at the board meeting, said in an e-mailed statement after the vote.