OAKLAND — BART employees will return to work and trains will begin rolling by Friday afternoon while the transit system and its unions continue negotiating over a new contract, leaders announced late Thursday after a marathon negotiating session.

Both sides have agreed that the current contract will remain in force through Aug. 4 while talks continue, said Marty Morgenstern, secretary of the state Labor and Workforce Development Agency.

That will be a huge relief to the hundreds of thousands of commuters who have endured lengthy commutes and major traffic jams since the strike began Monday.

“We’re very pleased that these workers will be back to work and the trains will begin running again,” Morgenstern told reporters when talks broke shortly before 11 p.m. Thursday.

He thanked the unions for agreeing to come back to work even though they have no contract agreement.

“It’s not easy to come off a strike without an agreement, but they are putting their faith in the recommendations we’re making,” he said.

BART General Manager Grace Crunican, who had been criticized by union workers earlier in the day for not being at the bargaining table, walked out of the negotiating session Thursday night and confirmed that trains would begin rolling by about 3 p.m. Friday.

“Unfortunately, the issues that brought us to this point remain unresolved,” she said. “Despite lots of hard work, BART and its unions have failed to come to an agreement on contract issues that matter to all of us today and into the future. We still have a wide gap of disagreements to bridge over the next 30 days.”

When asked what issues remain, Morgenstern replied, “I don’t have that much time.”

Antonette Bryant, president of the Amalgamated Transit Union, Local 1555, agreed the two sides remain far apart and accused BART of “hijacking the entire situation and causing anxiety” for the public.

“They have 30 days to get it right,” she said.

Traffic was lighter Thursday because of the July Fourth holiday, but the end of the strike will be welcome news to many commuters. Hundreds of East Bay residents who would normally take BART packed buses to head to the big fireworks celebration in San Francisco.

“I feel like the whole Fourth of July is going to be spent on a bus,” said David Bober, a 32-year-old El Cerrito resident as he stood waiting for a bus in downtown Oakland. He and his friends had planned to take a couple of buses to get to a San Francisco barbecue, then another one to the fireworks and yet another one to get home.

“I’m not sure how long the public is going to take this,” he said, sighing.

On Friday morning, BART will provide limited charter bus service to and from San Francisco during the peak commute periods. Accessible vans will also be available.

The buses and vans will pick up riders at the West Oakland, El Cerrito del Norte, Walnut Creek, Dublin/Pleasanton and Fremont stations. At 5 a.m., seven buses will arrive at each of these stations. Once a bus is filled, it will leave for San Francisco. There will be no transfers in West Oakland. It will be first-come, first-served. Each bus carries 50 passengers. The service will last only until all seven buses are filled or 8 a.m., whichever comes first.

AC Transit, meanwhile, will return to its regular weekday schedule on Friday.

Earlier Thursday, one labor leader said the talks were “not going well.”

A leader of Service Employees International Union Local 1021 signaled little sign of progress during the third day of negotiations since the strike began Monday and sent Bay Area commutes into turmoil.

Talks resumed at 11 a.m. Thursday after negotiations between management and officials from SEIU and Amalgamated Transit Union 1555 dragged on until near midnight Wednesday.

During a break from negotiations earlier in the day, SEIU chief negotiator Josie Mooney detoured to the Lake Merritt station to thank union members for their show of support on the holiday. While state mediators sent in by Gov. Jerry Brown ordered both sides to keep the talks confidential until a deal is reached, Mooney gave a brief update to union members.

Mooney said negotiations with BART were “not going well” and informed picketers that Crunican was still conspicuously absent from negotiations.

“I just have one more question: Where’s Grace?” Mooney asked an aroused group of picketers, some hoisting missing persons signs with Crunican’s face on them.

BART spokesman Rick Rice said top executives are rarely at the bargaining table day in and day out.

“She’s in touch with our negotiating team, and when the appropriate time comes, she’ll be there,” he said. She was at the negotiating session Thursday night to make the announcement that employees would return to work while negotiations continue.

About 150 BART SEIU employees rallied in front of the Lake Merritt station, chanting, “They brought the trains to a halt; don’t blame us, it’s management’s fault!”

“This rally shows we’re united. We’re still standing strong,” said Gregory Correa, Alameda County representative for SEIU.

The holiday provided a break for most of the hundreds of thousands of commuters left scrambling for alternative transportation this week. Still, plenty of workers and revelers were forced to find other ways to get to jobs and celebrations.

“It’s really inconvenient,” said Joseph Bernados, who planned to take a bus from downtown Oakland to the San Francisco fireworks. “It’s a very unfortunate situation that hopefully gets resolved soon. It’s terrible that the public is punished for this. We’re caught in the crossfire.”

BART once again offered chartered bus service from East Bay stations on Thursday, but only 15 buses were available instead of the 36 that were dispatched Wednesday morning. Most other Bay Area transit agencies ran reduced service for the Fourth of July and will be back to full strength Friday.

Negotiators are declining to publicly discuss what is happening behind closed doors, but heading into Tuesday’s talks, BART was offering an 8 percent pay increase, while unions were seeking a 20.1 percent hike.

The average blue-collar union BART worker now makes about $78,000 a year, including overtime.

BART was asking its unions, which do not currently contribute to their pensions, to pay steadily more until reaching a contribution of 5 percent after four years. The unions countered with a 0.5 percent annual contribution.

The final major issue is health care, for which all workers currently pay a flat $92 a month. Management wants the employees’ share to increase to 16 percent and for employees with more dependents to pay more.

With the holiday kicking off a long weekend for many people, rush hour Friday was not expected to be as crammed as earlier in the week. Still, that was little solace for Bay Area residents who crowded into buses to get to San Francisco’s fireworks celebration.

“It’s not fair to commuters, but I also understand the (union’s) part,” said Jessica Jones, who waited for a bus in downtown Oakland with her husband and 1-year-old son. “But they should have warned people ahead of time. It’s stressful. I’m not used to this.”

Staff writer Denis Cuff contributed to this story.