A judge ordered Prince George's County yesterday to pay $3.7 million to a construction firm whose permit to build two high-rise apartment houses in Hyattsville was withdrawn by the county six years ago.

Circuit Court Judge Perry G. Bowen ruled in favor of Herschel and Marvin Blumberg, ordering the county to pay the damages and reinstate the building permit for twin towers, 35 and 27 stories high, that the brothers had planned to build.

"We will appeal, of course," said

"Obviously we're delighted," said County Attorney Robert B. Ostrom. "We'll appeal on both the damages ruling and the permits." Joseph Blocher, the Blumberg's lawyer. "We had asked for $4.5 million but we are happy with the judge's ruling. The Blumbergs would still like very much to build these towers and they have the funds to do it."

The controversy dates to 1972 when the Blumberg brothers were granted permits for the towers by the County Council and the Washington Suburban Sanitary Commission.

But the project drew a storm of community protest, so the County Council held a special public hearing at a Hyattsville high school to hear citizen complaints.

After that, according to Ostrom, there arose technical problems with the building permit and questions of whether the builders had met all requirements. While the county and the builders were dickering, the Washington Suburban Sanitary Commission withdrew permits for water and sewer connections, saying the deadline for beginning construction had passed.

"When the WSSC pulled its permit, the county pulled the building permit because they couldn't build without a water and sewer permit," Ostrom said.

"The council and [then-county executive William W.] Gullett reacted to the community reaction and pulled out," Joseph Blocher, attorney for the Blumbergs, said last night.

The Blumbergs filed suit late in 1973 asking the courts to reinstate their permits. Then, in 1977, they amended the suit, asking for damages also.

Last spring, Bowen ruled that both the county and the WSSC were liable for damages caused the Blumbergs because the buildings were blocked. That set up a two-day hearing, ending yesterday, at which marketing experts testified for both sides.

Informed of the $3.7 million judgment, Robert Ennis, chief aide to County Executive Lawrence J. Hogan, exclaimed, "Wow! That is really a staggering figure. If that kind of money did have to be paid out it would certainly have to affect the county budget."

Ennis said Hogan wanted to read a transcript of the judge's ruling before commenting on it.

Until Wednesday, the county and the WSSC were codefendants in the case. But Bowen ruled Wednesday that because of a recent Court of Special Appeals ruling that makes the granting of water and sewer permits a discretionary government function, the WSSC was immune fromthe suit.

"That left us all alone," Ostrom said.

The Blumbergs also own a group of four office buildings on Belcrest Road in Hyattsville and a 600-unit Hyattsville apartment complex called Northwest Towers.