BILLINGS, Mont. — The nation’s largest freight railroad has agreed to more thorough inspections and maintenance improvements after a fiery oil train derailment in Oregon and the discovery of more than 800 potential safety violations across its sprawling network.

Details on the agreement between the Federal Railroad Administration and Union Pacific were obtained by The Associated Press.

Sixteen tank cars from a Union Pacific train hauling crude through the Columbia River Gorge derailed in early June along a curve in the tracks near Mosier, Oregon. The accident sparked a massive fire that burned for 14 hours and prompted the evacuation of nearby areas.

No one was injured. But federal officials said the railroad wasn’t following its own maintenance rules to ensure the track was safe. Better inspections would have caught a series of broken bolts that allowed the rails to move too far apart where the accident occurred, officials said.

The investigation into the accident is continuing.

Representatives of Union Pacific Railroad did not have an immediate comment on the agreement.

The more than 800 potential violations against Union Pacific were found as part of a two-year examination of tracks across the U.S. used to haul crude, federal officials said. Enforcement actions against the company have not been finalized and further details on the violations were not immediately available.

Federal Railroad Administrator Sarah Feinberg said the agreement raises the bar on safety.

“This compliance agreement requires Union Pacific to go above and beyond existing regulations,” she said.

The oil industry has become heavily reliant on trains in recent years because of limited pipeline capacity in the booming oil patch of the Northern Plains and the oil sands region of western Canada.

Omaha, Nebraska-based Union Pacific operates more than 32,000 miles of track across 23 states.

The safety measures included in the agreement with the FRA will apply to all track used to haul oil and other hazardous liquids, passengers, explosives, radioactive materials and poisonous gases.

They include an inventory of all curves in the track that are three degrees or greater across that network and walking inspections every 120 days on tracks that have the type of bolts involved in the Mosier accident. Those inspections have to occur every 30 days in that part of the network that includes the Mosier area.

Previously, Union Pacific said it would voluntarily take some of the same steps within the Columbia River Gorge.

At least 27 oil trains have been involved in major derailments, fires or oil spills in the United States and Canada in the past decade, according to an AP analysis of accident records. The trains travel through more than 400 counties across the U.S. to reach refineries on the West, East and Gulf coasts, according to the AP analysis.

A 2013 derailment killed 47 people when a runaway oil train from North Dakota jumped the tracks and exploded in Lac-Megantic, Quebec.

Damage from that accident has been estimated at $1.2 billion or higher.