WASHINGTON, D.C. — The nation’s top rail regulator issued an emergency order Friday banning unattended trains on main rail lines to prevent disasters similar to the runaway train that killed 47 people in Quebec last month.

The Federal Railroad Administration announced the order the same day that U.S. Reps. Mike Michaud and Chellie Pingree, D-Maine, proposed a bill requiring two-man crews on freight trains.

“Safety is our top priority,” said U.S. Transportation Secretary Anthony Foxx. “While we wait for the full investigation to conclude, the department is taking steps today to help prevent a similar incident from occurring in the United States.”

All railroads must comply with the order in 30 days. It requires:

• No train hauling specified hazardous materials can be left unattended on a main track or track near a yard or terminal unless authorized.

• Railroads must submit guidelines to FRA for securing unattended trains hauling hazardous materials, including locking or disabling locomotives.

• Workers aboard trains transporting hazardous materials must report to dispatchers the number of hand brakes applied, the train’s tonnage and length, the track’s grade and terrain, relevant weather conditions, and the type of equipment being secured.

• Train dispatchers must record the information and verify that the parking securement meets the railroad’s requirements.

• Railroads must ensure that workers who secure trains participate in daily job briefings. Qualified workers must inspect all equipment that emergency responders have handled before trains can be left unattended.

“The safe shipment of all cargo is paramount and protecting the safety of the American public is fundamental to our enforcement strategy,” FRA Administrator Joseph C. Szabo said in a statement. “We are encouraged by the industry’s willingness to cooperate with this approach.”

The announcement comes after Michaud and Pingree urged FRA administrators to order the upgrade of about 40,000 DOT-111 oil tanker cars like those that exploded in Lac-Megantic on July 6.

The Montreal, Maine and Atlantic Railway train was parked near Lac-Megantic on a fairly steep grade of a main track — and its engineer had left for the night — when a fire broke out in a locomotive, Canadian officials have said. Firefighters doused it and the train’s air-brake system was released when the engine powering it was shut down.

The train should have remained parked, but Ed Burkhardt, the president of Rail World Inc., MMA’s parent company, said officials suspect that the engineer did not set enough hand brakes. Other sources said that other MMA workers were aboard after the fire.

The train went downhill into the town about 45 minutes after the fire was doused. It derailed and many of its 72 oil tankers exploded.

Burkhardt dismissed the idea that a two-member crew might have prevented the accident as a “red herring.” He has defended remote-controlled engines since MMA began using them in 2010.

Almost immediately after the accident, Canadian officials ordered that all freight trains handling hazardous materials have two-man crews, a requirement the Hermon-based freight company is following in Canada, Burkhardt said.

A safety advisory FRA also issued Friday endorsed crews of more than one. It recommended that railroads review staffing levels for trains hauling hazardous materials and advised evaluations that would remove train-parking hazards.

Michaud’s federal bill, announced Friday, would require at least two-person crews on freight trains. Pingree is an original bill co-sponsor.

“Trains can be a mile or more long and carry volatile shipments such as ethanol and oil,” Michaud said in a statement. “With a single person crew, what if the operator suffers a heart attack or another healt- related problem? What if there is an accident and the operator is unable to perform his or her duties?”

Michaud’s office released a brief statement late Friday which said that the FRA’s executive order was “a positive development” that “falls short of a full endorsement of requiring a change in procedure.”