California Gov. Gavin Newsom signed a measure Monday that will ban public rail agencies from selling their oldest diesel locomotives after they’ve been retired.

What happened: Newsom approved SB 30, a bill from Senate Transportation Chair Dave Cortese that will restrict agencies like Caltrain and Amtrak from selling or donating locomotive models built before 2005.

Why it matters: The bill was a direct response to Caltrain’s decision last November to sell its retired diesel train fleet to city officials in Peru after launching electric service on its route between San Francisco and Santa Clara County. The planned sale drew immediate pushback from Cortese and some environmentalists, who argued that California was exporting its pollution to another country.

More details: SB 30 restricts the sale or transfer of decommissioned Tier Zero and Tier One locomotives, which have fewer pollution controls than newer models and account for roughly half of the locomotives operating in the state.