Uber and Lyft spent nearly $675,000 lobbying California lawmakers over the summer as the two ride-hailing companies fought unsuccessfully for a carve-out from landmark labor legislation, new disclosures show.

Lyft paid $446,450 to sway decision-makers in the third quarter, the period when the Legislature took final votes on, and the governor signed, Assembly Bill 5. The legislation codifies much of the California Supreme Court’s 2018 ruling in Dynamex Operations West v. Superior Court, making it tougher for gig companies to classify their workers as independent contractors.