A Maryland judge has issued a temporary restraining order requiring the companies managing construction of the Purple Line to stay on the job until at least Sept. 14, while they and the state continue to argue about hundreds of millions of dollars in cost overruns.

The Maryland Transit Administration sought the order as part of a lawsuit filed Monday against the companies in the Circuit Court for Baltimore City. The suit accuses the private consortium, Purple Line Transit Partners, of breach of contract.

The lawsuit alleges that the consortium “unlawfully” planned to end its 36-year, public-private partnership with the state and allow its construction contractor to walk off the project Aug. 22 if no agreement was reached on a reported $755 million in unpaid expenses. The state has asked the court to rule on the “rights and liabilities” in the contract and to fine the consortium more than $75,000 for starting to pack up construction sites and trying to terminate the partnership.

In granting the state’s motion for a temporary restraining order late Monday, Circuit Court Judge Jeffrey M. Geller wrote that he agreed the state would suffer “irreparable harm” if Purple Line construction is delayed. He also agreed that the state would “incur inestimable amounts of additional damages” and that there would be “harm to the general public,” according to the order.

The state had argued that the construction contractor had begun to dismantle and remove a heavy-duty crane in downtown Bethesda that would take six months to a year to replace. The project’s new operations and maintenance facility in Prince George’s County also was about to lose electricity, which could damage about $10 million worth of equipment that needs climate control, the state said in a court filing.

The judge wrote that the companies are “restrained from demobilizing and abandoning the project” until they follow the contract’s dispute resolution process to prove that they have a right to exit the project because of “extended” delays.

The contract allows either the state or the consortium to terminate the partnership if construction delays exceed 365 days. The consortium says delays have added up to more than 2.5 years. However, the state has argued that the companies have illegally threatened to “abandon” the project because the state has not agreed that the delays are valid.

In a statement, Purple Line Transit Partners said it disagreed with the state’s arguments but would “fully comply” with the judge’s order. A spokesman for the consortium declined further comment, citing the pending lawsuit.

The construction contractor, a joint venture known as Purple Line Transit Constructors and led by Texas-based Fluor, said it disagrees with the judge’s order, which it described as “not uncommon” in such a case. A full court hearing, the contractor said, will show that the companies “have the unconditional right” to leave the project.

The companies, the statement said, have “offered multiple creative solutions” to complete construction “while minimizing costs,” including by doing so at no profit and by sharing in any cost overruns with the state.

The lawsuit and judge’s order significantly escalate a years-long dispute between the Maryland Transit Administration and the companies over who will pay the delay-related costs.

They also don’t bode well for the two sides reaching an amicable deal that would keep the companies on site voluntarily. Without an agreement, the state has said it is prepared to take over contracts with subcontractors and manage the highly complex construction itself.

The Purple Line, which will connect Montgomery and Prince George’s counties, is designed to provide more reliable public transportation than buses and attract economic development around stations.

It initially was scheduled to begin carrying passengers in March 2022. However, the contractor has said it won’t open until late 2024, unless construction is accelerated.

Lawsuits over breach of contract can take months or years to resolve because they often center on highly complex contracts — 876 pages in the case of the Purple Line.

The $5.6 billion partnership has received national attention because it is the first U.S. light-rail project and the second U.S. transit project to include private financing. If it dissolves, the state would have to find another way to structure about $1 billion of debt at a time when tax revenue has been hit hard by the pandemic.

Under the partnership, Purple Line Transit Partners is supposed to design and build the line over six years, help finance its construction, and then operate and maintain it for 30 years. The state has paid the consortium’s construction costs along the way and will then pay an average $150 million annually for the consortium to operate and maintain the line, pay off its construction debt and turn a profit.

The arrangement was intended as a way for the state to share the risks of delays — and the costs that go with them — with the private sector, based on which was best equipped to handle them. Purple Line Transit Partners is composed of Meridiam, Star America and Fluor.

But construction got off to a late start after a lawsuit by opponents delayed it by about a year. Other problems stemmed from slow property acquisition and changes in requirements for state environmental permits and a crash wall along CSX tracks, according to the consortium.

The state’s court filings follow a recent exchange of letters between the Maryland Transit Administration, the consortium and the consortium’s construction contractor over whether the state may take over managing construction.

On Aug. 5, the state sent letters to 171 subcontractors saying it planned to take over their contracts. The letter also asked the subcontractors to hold off on leaving the project.

Two days later, Purple Line Transit Partners told the state it had no right to contact its subcontractors because it had not notified the consortium in writing that it would be taking over the contracts.

The construction contractor’s lawyer wrote that the state’s letters had created “mass confusion across the project” and that the state would be liable for any costs related to its “unjustified” and “tortious interference” with the subcontractors.

The lawyer’s letter told the state to “immediately cease and desist” contacting the subcontractors until the state properly took over those contracts.

The construction contractor said it would begin terminating those contracts as of Aug. 22 unless the state had put in writing by Monday that it was assuming them.