WASHINGTON — A recent U.S. Department of Transportation requirement to limit the release of information about Bakken crude oil shipments by rail has set up a conflict between railroads, states and the federal government that could wind up in court.

DOT and the railroads want state agencies to keep the information confidential, but some states have not agreed to comply, citing their open-records laws. Washington state is among the states that did not sign a nondisclosure agreement with railroads.

On Tuesday, McClatchy received a response to an open records request submitted Monday to the Washington state Military Department. The state has given BNSF Railway until June 24 to seek a court order to block the release of information that McClatchy requested about crude oil train frequency, volume and routing in state.

In an email, BNSF spokeswoman Courtney Wallace declined to say how the railroad would respond.

An increase in crude oil shipments, and accidents, have drawn new scrutiny to an industry accustomed to operating out of public view.

It began almost a year ago when a crude oil train disaster in Quebec killed 47 people. Subsequent accidents in Alabama, North Dakota, Pennsylvania and Virginia, though not fatal, underscored the lack of knowledge at the state and local level about the shipments.

After a 105-car CSX crude oil train derailed in downtown Lynchburg, Va., on April 30, the city’s mayor said he was not aware of such trains moving regularly through his community.

On May 7, DOT ordered railroads to provide states with information about Bakken crude oil shipments of 1 million gallons or more to help emergency responders. But the agency also requested that such information be kept confidential by the states, calling it “security sensitive.”

BNSF, the largest hauler of crude oil by rail in the nation, has taken steps to improve the safety of the shipments, including an unprecedented purchase of 5,000 new tank cars built to tougher standards than currently required by the industry or the federal government.

It also wants to limit the release of information about where it ships crude oil. However, some of that information is publicly available from an unlikely source: the railroad itself. An online map of BNSF crude oil facilities shows that it serves five in the Pacific Northwest, including four in Washington.

The map also shows the routes the railroad has available to move the oil from North Dakota and other states to the West Coast.