A potentially dangerous rail crossing was recently closed in St. Paul Park, and officials say it's not a moment too soon.

The crossing at Hastings Avenue and First Street was a busy nexus for trains, some hauling crude oil from North Dakota, traversing through the Washington County city of just over 5,000. It's near an oil refinery and was the site of a 2015 accident that saw a train plow into a semitrailer truck.

The rail crossing also had the dubious distinction of being highlighted as a "high-safety risk" in a 2014 report compiled by the Minnesota Department of Transportation.

"It wasn't a matter of 'if,' but a matter of 'when,' "said St. Paul Park Mayor Keith Franke, referring to the potential for a catastrophic accident.

Last week, MnDOT celebrated the crossing's closure. This "takes away another potential point of contact between the public and trains in the state at a high-risk location," said Jim Weatherhead, project engineer. "We like to close crossings whenever we get the chance."

Up to 50 BNSF Railway trains rumble through the area daily carrying a variety of goods and commodities, and Amtrak uses the line for passenger service.

Amy McBeth, a BNSF spokeswoman, said the railway has closed more than 6,000 at-grade crossings since 2000. If there's a way to close a crossing and offer a viable alternative for traffic, the company will work with the community to do so, she said.

That was the case in St. Paul Park, where the area's extensive commercial truck traffic is now diverted to a nearby overpass.

"It's working out just fine," said Jason Wood, manager of L-J Tire, which is near the crossing. "Not everyone knows the crossing is closed, but that will work out in time."

Work on the project cost $954,000 and involved removing the existing road, building a cul-de-sac with a turnaround and restoring the area. BNSF chipped in $100,000 and loaned equipment and crews for the job.

After a train and semitrailer truck filled with flour collided at the intersection in June 2015, Gov. Mark Dayton visited the site and urged lawmakers to better fund rail safety improvements.

No one was injured in the crash, but Dayton called for the crossing's removal.

"We had already entered into negotiations to get this project underway when the semi was hit by the train," Weatherhead said. "As you might imagine, that gave a little more urgency to the project, and focused a few more eyes on it."

The pervading concern with such a collision — beyond people getting hurt — is that a train may derail, rupturing a car and igniting a fire, he said. The proximity of a refinery in the area adds to these concerns.

MnDOT continues work on other potentially dangerous rail crossings highlighted in the 2014 report. The report studied 100 high-risk rail crossings throughout the state and concluded it would cost $280 million to upgrade them.

The department is close to completing a study indicating that a grade separation — a permanent separation of road and rail traffic — is feasible at a BNSF rail crossing on Ferry Street in the city of Anoka. The project will then move into a preliminary design phase, meaning it's ready for funding.

Two other grade separation projects, on Hanson Boulevard in Coon Rapids, and on Sturgeon Lake Road near Red Wing, are awaiting construction funding.

The fate of another potentially dangerous intersection, in the Como Park neighborhood of St. Paul, is unclear. "After discussions with the city of St. Paul, the city indicated it was not interested in developing a proposal to grade separation at this location," MnDOT said.

St. Paul's Public Works department "is open to [a grade separation] based on the limited amount of information we have received to date," said spokesman Joe Ellickson.

He said a more detailed study and community input would have to take place before a decision is made.

The MnDOT report stated that a bridge in the Como Park area separating rail and street traffic would cost about $25 million.

Rep. Frank Hornstein, DFL-Minneapolis, said rail companies should pay for these safety improvements.

He authored a bill requiring that, but the measure failed to gain traction.

"The public sector should not be paying for this," Hornstein said. "The [rail companies] are the ones profiting. If they're expecting the public to pay for most of this, it really amounts to corporate welfare."