DETROIT (AP) — Starting in about two years, all new semi trailers in the U.S. will have to have stronger guards to stop cars from sliding under them in rear-end crashes.

The National Highway Traffic Safety Administration said Thursday that it finalized the requirement. Manufacturers will get time to design changes to strengthen the guards so they prevent most rear underride crashes.

Such guards have been sought by safety advocates for years to prevent the crashes, which often are deadly.

The agency also says it will research side underride guard requirements for large trailers, with plans to start the regulatory process to require them.

NHTSA Administrator Steven Cliff said in a statement that the rear underride impact guards will improve protection for people in passenger vehicles. The rule was required by Congress under the bipartisan infrastructure law.