A powerful and politically connected Philadelphia law firm agreed Tuesday to a $4 million payment to resolve a lawsuit contending that a former partner hoodwinked the chief justice of the Pennsylvania Supreme Court while helping find a site for a new Family Court building.

The firm, Obermayer Rebmann Maxwell & Hippel, will pay $2 million to the Philadelphia courts. Its insurer will pay the rest. Jeffrey B. Rotwitt, the former Obermayer partner at the center of the controversy, agreed to the settlement but did not have to pay any money.

Chief Justice Ronald D. Castille praised the deal, saying it recovered the $2 million paid to Rotwitt as well as the payments to consultant William G. Chadwick and lawyer Richard A. Sprague to investigate Rotwitt's conduct and mount the lawsuit, filed 13 months ago.

"The parties that were responsible stepped to the plate and have given us what we think is appropriate," Castille said.

The Obermayer firm had no comment. Rotwitt, whom Obermayer fired after the scandal broke, said the settlement vindicated him.

"I don't contribute a nickel to anything," he said. "From my standpoint, it's a total victory that corroborates all that I was saying from Day One."

Castille said Rotwitt's elation was misplaced. He added: "Everybody can dance over there, but we have $4 million."

Castille said the money would be used only to help outfit the $180 million Family Court building, now under construction.

As part of the deal, all parties agreed to drop their suits and countersuits. With the last signatures Tuesday, the curtain has fallen on a drama that raised questions about the ethics and competence of some of the region's most prominent lawyers and law firms - and also about Castille's oversight.

While magnificent from the outside, the Depression-era Family Court building on Logan Square has been notoriously unsuitable for its clients for years. Domestic cases have been handled in an even shabbier facility on 11th Street near Market Street.

To find a location for a new building, then-Supreme Court Justice Sandra Schultz Newman in 2006 hired Rotwitt, an Obermayer lawyer with extensive real estate expertise. Castille, a former Philadelphia district attorney, took over as project overseer after Newman retired.

And as the courts settled on a site at 15th and Arch Streets, Rotwitt began wearing a new hat - he became a business partner of the developer with rights to the site.

Before Rotwitt's dual roles exploded into public view and his payments were cut off, Obermayer was paid $1.1 million for his legal work on the Family Court building - and Rotwitt collected an additional $825,000 in his developer role.

When Inquirer architecture critic Inga Saffron broke the news of Rotwitt's dual roles in 2010, Castille initially defended Rotwitt. (On Tuesday, Rotwitt said he and Castille had once been "very, very close" and had golfed together many times. Castille has said he was not so close with Rotwitt.)

But the chief justice soon switched course, accusing Rotwitt of failing to to reveal what Castille said were his conflicting roles. Shortly after that, the Obermayer firm fired the politically active Rotwitt, who had worked there 35 years and was reported to be one of its biggest moneymakers.

The court's dismissal meant Rotwitt never collected an additional $1.7 million he was due to make in developer fees, according to court officials.

As the courts settled on the 15th and Arch building, Rotwitt became a 50/50 member of a development team for the site headed by builder Donald W. Pulver.

In the lawsuit, Castille charged that Rotwitt repeatedly dodged opportunities to be up-front about his dual roles or was outright duplicitous.

In one episode, the suit says, when Castille was under pressure in 2010 to explain the deal to The Inquirer, Rotwitt drafted a statement that made no explicit mention of his role, After Castille approved it, the suit says, Rotwitt then altered the statement to add such a disclosure without telling the chief justice.

Castille said Tuesday that he had not realized he had to watch Rotwitt so closely.

"We expected absolute loyalty from our lawyer, and we didn't get it," Castille said. "I trusted in my lawyer."

Sprague, paid $1 million to represent the Philadelphia court system, and Castille also laced into Rotwitt in an interview Tuesday.

"The litigation confirms that Rotwitt was fired [by the courts] for having an undisclosed financial interest. He was fired by his law firm for the same reason," Sprague said. "This litigation confirms all of that."

The fact that courts would now collect $4 million, Sprague said, "speaks louder than any words from Rotwitt or me."

The Chadwick consulting firm was also paid $1 million to investigate the suit, as well as to restart and oversee construction of the Family Court building.

For his part, Rotwitt said Tuesday that he still found it "incomprehensible" that Castille had criticized him.

"My functioning as a developer was disclosed and approved in advance by the court," Rotwitt said.

Rotwitt said Tuesday that he had declared his two roles in many public documents and had discussed them directly with Castille on "innumerable occasions."

During the litigation, Rotwitt's lawyer said in court documents that while Rotwitt had told Castille he was "codeveloper" many times, he had told the chief justice he and Pulver were sharing fees on "on one occasion," in late 2007.

In the court documents, Rotwitt could not provide a specific date for this conversation, say where it took place, or recall precisely what was said, Sprague attorneys said.

Asked about this Tuesday, Rotwitt's lawyer, Katie Recker, replied, "Look, the result trumps these tired arguments."

As the scandal unfolded over the last two years, questions were also raised about other lawyers hired by the high court to watchdog the process but who never flagged Rotwitt's various roles.

The controversy also proved embarrassing for former Justice Newman, who first hired Rotwitt. The Inquirer revealed that Newman, after stepping down from the high court, wrote Rotwitt to urge that her son, also an Obermayer lawyer, be paid for introducing her to Rotwitt. The son said he didn't know about his mother's pitch and was not paid.

In a farcical episode, Newman, asserting sickness and schedule conflicts, for months would not give Sprague a deposition in the Family Court lawsuit. During those months, she went on vacation and attended the gala opening of the Barnes gallery on the Parkway.

The new Family Court building, 15 stories high with 29 courtrooms, is to be finished in June 2015.

If it weren't for the breakdown of the project amid controversy, Castille said, the building would likely have been completed a year earlier.

Contact Craig R. McCoy at 215-854-4821 or cmccoy@phillynews.com.