Amtrak has completed its eight-week Penn Station summer infrastructure repair work that diverted some LIRR commuters from the Manhattan hub, clearing the way for normal operations to resume next week.

The true test comes Tuesday when full service is scheduled to be restored for all of Penn’s users — the Long Island Rail Road, Amtrak and NJ Transit. The project shut down three to five of Penn’s 21 tracks in an area that doesn’t directly serve LIRR trains, however, problems there have reverberated beyond the station and caused headaches for thousands of Long Island commuters.

Amtrak will continue its track work at Penn during nights and weekends into next year, albeit with less impact than the summer project, Amtrak chief operating officer Scot Naparstek said Thursday. However, the agency will do so facing a backlog of $38 billion in state-of-good-repair work at Penn and throughout the Northeast Corridor, including the $24 billion Gateway Tunnel project, he warned.

“What we did today is get better, get stronger and more reliable at running this station as we do every day. It does not give us more capacity; it puts us back to the same capacity — it’s always important to remember that,” said Naparstek at a Penn Station news conference. “Gateway is extremely important because it gives you more capacity; it buys us more service.”

Amtrak’s summer work at Penn focused on “A Interlocking.” The critical sorting mechanism routes incoming and outgoing trains that enter and exit Penn from the Hudson River tunnel and the LIRR’s West Side Yard to the various station tracks and platforms.

“This accelerated work was an enormous undertaking,” said Amtrak co-chief executive Charles ‘‘Wick’’ Moorman in a statement. ‘‘We did it on time, on budget, and most importantly, safely.’’

advertisement | advertise on newsday

The interlocking has been a sore spot for Amtrak, which owns and operates the nation’s busiest rail hub. Several derailments this year have been blamed for frequent delays that have plagued LIRR riders and other commuters.

Naparstek thanked them for their “amazing patience” and “flexibility” during the renewal project, which forced the cancellation or rerouting of more than two dozen rush-hour LIRR trains at Penn Station. The Metropolitan Transportation Authority in response crafted a roughly $58 million emergency plan that included a network of charter buses, ferries and free subway transfers at hubs such as Hunterspoint Avenue in Queens and Atlantic Terminal in Brooklyn for affected commuters seeking transit alternatives.

The summer commute went more smoothly than many had predicted, including Gov. Andrew M. Cuomo, who coined the phrase the “summer of hell.” Cuomo this week praised the MTA’s planning and service, which overall was more reliable than usual during Amtrak’s repairs.

Despite having to reduce rush-hour service to and from Penn, the LIRR’s 93.1 percent on-time performance in July was the best of any month in 2017. August could top that, MTA officials say.

“We said this summer had the potential be the ‘summer of hell.’ It did,” Cuomo said in a statement Wednesday. “It was prevented by the preparation, communication, and execution of our mitigation plan and the LIRR saw its best on-time performance of the year during these months — standards of service they must uphold year-round.”

“The progress made this summer is clear proof that when the responsible agencies are focused and engaged [and know the world is watching] the quality of service can be demonstrably better,’’ said Sen. Todd Kaminsky (D-Long Beach), a frequent critic of the LIRR, on Thursday.

The repairs were sparked by two derailments at Penn Station, through which some 600,000 people travel daily, within a two-week period last spring. Naparstek did not rule out the prospect of another similarly impactful rehab project down the line, but promised that Amtrak will be more diligent in avoiding further safety risks.

“One of our lessons learned is we have to be aggressive,” Naparstek said. “It should not take a derailment — it will not take, in the future, derailments.

“If we see work that needs to be done that puts the reliability of the station at risk, then we’ll come forward in working with our partners on how to do that work successfully,” he said.

About 360 employees worked on Amtrak’s project, installing 897 track ties and laying what measured out to six football fields of new rails. Even with all the work, transit experts said true relief for the region won’t come without the completion of Gateway, which would create an additional set of railway tunnels connecting New York and New Jersey under the Hudson River.

advertisement | advertise on newsday

“The region’s rail commuters have suffered for a long time. It’s good to hear the ‘summer of hell’ isn’t expected to last into the fall. That said, this is a short-term improvement,” said Joseph Cutrufo, spokesman for the nonprofit Tri-State Transportation Campaign. “As Naparstek said, there’s a lot of long-term needs that this hasn’t addressed and there’s still a lot more.