John Bacon

USA TODAY

A strike that paralyzed public transportation in Philadelphia for a week ended Monday when the Southeastern Pennsylvania Transportation Authority (SEPTA) and a union representing almost 5,000 employees announced a deal on the eve of Election Day.

"Tentative agreement reached. We are off strike, " TWU Local 234 announced on its website.

The deal was struck hours after the transit agency announced it was seeking a court injunction to force its employees back to work. SEPTA said any disruption of public transit would inhibit city residents from voting in Tuesday's elections.

SEPTA workers walked out after midnight Nov. 1 over issues including pension benefits and the amount of time off given to drivers between shifts. The strike idled subways, buses and trolleys that provide almost 1 million rides each weekday.

Service was phased in throughout the day, and many routes were in place by the evening commute Monday. SEPTA said service was expected to be fully restored Tuesday.

Philadelphia is the nation's fifth-largest city, and many of its 1.5 million residents don't own cars. Any issue that might disrupt voter turnout Tuesday would be problematic for Mayor Jim Kenney and other Democratic leaders of this overwhelmingly Democratic city that is expected to provide big numbers for Hillary Clinton's presidential bid. Pennsylvania is considered a swing state, and Republican hopeful Donald Trump has worked hard to claim its 20 electoral votes.

The U.S. Senate race is also close, and the city's turnout could determine the fate of Democrat Katie McGinty's challenge to GOP Sen. Pat Toomey.

Philadelphia transit strike sends hundreds of thousands scrambling for rides to work

"The City has a legal responsibility to ensure that Philadelphians can exercise their constitutional right to vote,' SEPTA said in a statement announcing the injunction request. "Though there are extensive efforts to minimize the effect of any transit strike on Election Day, unquestionably, such an Election-Day strike will make it practically impossible for many Philadelphians to participate in this election."

Democratic Gov. Tom Wolf spoke out Sunday in favor of the injunction, citing "grave economic consequences for both the city and the Commonwealth of Pennsylvania." On Monday, Wolf issued a statement to "commend both sides for bringing this crippling work stoppage to an end."

The deal ends the court battle, but it must be ratified by union members and approved by the SEPTA board. The agreement brings relief to hundreds of thousands of commuters who suffered through extended commutes and massive highway gridlock as workers scrambled to find alternative transportation.

“We believe this agreement is fair to our employees, and to the fare-paying customers and taxpayers who fund SEPTA,” agency Chairman Pat Deon said. “It provides for wage increases, pension improvements, and maintains health care coverage levels while addressing rising costs.”

Contributing: Jane Onyanga-Omara