A Commonwealth Court judge Wednesday halted plans to replace Graterford Prison, ruling that state officials violated bidding laws for the $365 million project.

The injunction, signed by Judge Dan Pelligrini, is likely to delay the March 2014 opening of a new, 4,100-bed prison and the demolition of the neighboring 3,000-bed facility it is expected to replace.

State officials hoped to break ground this fall on the Montgomery County site.

In his opinion, Pelligrini said the state's Department of General Services was wrong to limit the list of prospective contractors to just three after the first phase of the bidding process. At that stage, developers lay out their credentials and vision, but not a cost bid.

The department also planned to let the winning contractor unilaterally choose mechanical, electrical, and plumbing subcontractors instead of using a competitive sealed-bidding process as required in state contracts.

State officials maintained that the process was fair and legal because prison overcrowding is a fast-growing problem and the so-called short-listing of contractors would lead to quicker results.

A group of more than 20 individuals and companies sued, claiming that they had been unfairly shut out in the process and that the state was flouting its own rules.

"It was very clear that they weren't complying," said Diane Tokarsky, a lawyer for the builders.

The judge agreed. He said budget concerns or a ticking timetable were not reason enough for the state to ignore the laws on competitive bidding.

Pelligrini acknowledged that his ruling could delay the Graterford project, but said, "It will harm the public more if we allow the department to willfully violate the law."

Ed Myslewicz, a spokesman for the General Services Department, said its attorneys were reviewing the ruling and had not yet decided whether to appeal.

He said the decision could have a ripple effect on other projects, notably a new prison in Fayette County.

"Obviously, we are disappointed by the opinion, because it affects a tremendous amount of construction activity," he said.

The groups originally allowed to bid were Walsh Construction and Heery International; P.J. Dick Inc./Hunt; and Keating Building Co.