PORTLAND, Maine — Maine no longer will disclose to the public any details about shipments of crude oil by rail through the state, an official said Wednesday, a move that has angered activists who say the information is critical to public safety.

The state’s Department of Environmental Protection on Wednesday declined a reporter’s request for monthly volumes of crude oil shipped by rail, citing a June law that prohibits emergency responders from disclosing certain details about rail shipments of hazardous materials through the state.

“When people are aware of what’s coming through their community, they pay attention,” said Bob Klotz, a spokesman for 350 Maine, an activist group that has protested oil-by-rail cargoes in the state. “To take that information away is very concerning.”

The U.S. and Canada are grappling with environmental and safety risks posed by a surge in oil-by-rail cargoes, following several fiery derailments of trains carrying Bakken crude oil in North America.

A U.S. Department of Transportation Executive Order in 2014 required railroads to inform emergency responders about large cargoes of Bakken oil passing through their states.

But many railroad companies, citing security concerns along their tracks, have lobbied to keep that information from the public.

A spokesman for the Association of American Railroads, which represents freight railroad operators, declined to comment on the Maine law but said the group supports the federal order requiring cargoes be disclosed to emergency responders.

Lawmakers passed the Maine bill, which would prohibit the public from accessing the same information as emergency responders, over the objections of Gov. Paul LePage, a Republican, who vetoed the legislation in June.

“I am not at all comfortable shielding this information from the Maine citizens that may be placed in harm’s way,” LePage wrote in his message about the bill, one of about 100 he vetoed this year.

A spokesman for Maine’s Department of Environmental Protection said the agency was still “seeking guidance” on how to implement the law.

Only one railroad company, Pan Am Railways, based in North Billerica, Massachusetts, has continued to ship crude through Maine after an oil train exploded in neighboring Quebec in June 2013, killing 47 people.

Pan Am did not reply to requests for comment.

Before that crash, Maine had been among the largest oil-exporting U.S. states, transshipping millions of barrels of crude by rail from North American oilfields mainly to Irving Oil’s refinery in Saint John, New Brunswick, which is Canada’s largest.