US commuter railroads and passengers are breathing a sigh of relief as freight rail companies and the unions that represent their workers averted a potential freight strike that would have crippled their services. Labor unions and management from railroads including Union Pacific, CSX and Norfolk Southern struck a tentative deal early Thursday to prevent a strike that would’ve devastated much of the US economy. It would have been the first rail strike in 30 years. The deal still needs to be ratified by union members to completely end the risk of a strike. Amtrak had canceled all of its long distance trains earlier this week. It said Thursday morning that it was working to quickly restore service and alert impacted customers of available departures. The strike also would have forced many local and regional passenger services to shut down as they often rely on freight rails to operate the trains or track infrastructure. Services that would have been impacted by the strike began to alert customers Thursday morning. “We are greatly relieved that we will be able to continue to provide the safe and reliable service that you deserve and that you rely upon,” Metra, which operates commuter rail in the Chicago area, told customers in a statement Thursday. “Please accept our apologies for this week of uncertainty and anxiety.” Metra expected it would have to shut down nine of its 11 lines Friday, which carried an average of 36 million passengers annually from 2019 to 2021. It warned passengers earlier in the week that some trains would halt service as early as Thursday night. Jim Mathews, CEO of the Rail Passengers Association, which advocates for train riders, credited the Biden administration with pushing to complete a deal. Labor Secretary Marty Walsh hosted about 20 hours of talks and President Biden called in to talk with negotiators Wednesday evening. Biden, sometimes called “Amtrak Joe” because he rode Amtrak almost daily from his home in Delaware to Washington when he was in the US Senate, has spoken of igniting a rail renaissance in the US. The bipartisan infrastructure bill, passed last year, invested $66 billion in rail. “A strike really would have been a pretty significant blow to the larger policy goal of trying to start the rail renaissance,” Mathews said. “This deal is such a testament to their commitment.” Pete Muntean and Adrienne Broaddus contributed to this report.