Republicans had controlled the bench since 2010, and hoped to retain the majority. But the Republican nominees - Judges Judy Olson, Mike George, and Anne Covey - were solidly defeated, as was independent Paul Panepinto.
The new members will remake a court that has been racked by turmoil and infighting in recent years: Two justices since 2012 have resigned in disgrace, while another still on the bench has been mired in a scandal over pornographic email.
Political observers say that whatever effect those events have had on the court's image, Tuesday's winners - elected to 10-year terms at a salary of $203,000 a year - will inhabit prestigious roles with a near-incomparable ability to influence Pennsylvania.
"The state Supreme Court . . . regularly has to weigh in on decisions regarding legislation and executive actions that have enormous repercussions," said Christopher Borick, political science professor at Muhlenberg College in Allentown. "Establishing the direction of the court is incredibly important."
Two nonpartisan watchdogs labeled this contest - the only state Supreme Court race in the country this year - the priciest in American history, with expenses totaling nearly $16 million.
And the Democratic victors collected the lion's share of that money.
Dougherty raised more than $3.5 million, records show, and he benefited from huge contributions from his brother's union and others. Those same unions were major contributors to Wecht and Donohue as well, as were trial lawyers groups, according to campaign finance records.
Combined, records show, the three Democrats - who often appeared to run as a ticket - raised about $8.5 million.
By comparison, their four competitors - three Republicans and one independent candidate - combined to raise less than $3 million.
Lynn Marks, executive director of another watchdog group, Pennsylvanians for Modern Courts, said that money aside, this election could be a turning point for the state's justice system.
"There is a real opportunity for the Supreme Court to move into its next chapter," she said.
The state's two other appellate courts also had elections Tuesday. Democrat Alice Dubow, a Philadelphia Common Pleas judge, won a seat on the state's 15-member Superior Court. Allegheny County attorney Michael Wojcik, also a Democrat, won a place on the nine-member Commonwealth Court.
But the Supreme Court was the contest that drew the most competition.
Two of the vacancies were created when former Justices Joan Orie Melvin and Seamus McCaffery resigned - Melvin after being convicted for corruption, McCaffery to end an inquiry into X-rated emails. The other seat became open when former Chief Justice Ronald D. Castille reached the mandatory retirement age of 70.
The candidates, all judges, were evenly split by party affiliation - three Republicans, three Democrats, and one independent - as well as geography. Three were from the Philadelphia area, three from around Pittsburgh, and one from Gettysburg.
Dougherty, 53, did not shy away from the connection to his powerful brother. On the campaign trail, he said he was proud of the relationship - and insisted it would have no effect on how he would rule from the bench. Last week, Dougherty held a rally at Philadelphia's City Hall to tout endorsements from all 12 Democratic City Council members.
His campaign also spent nearly $3 million on television advertising in 2015, according to the Center for Public Integrity, outpacing all other candidates and political groups.
Wecht, 53, was also visible on television. The Superior Court judge received sizable donations from many of the same groups as Dougherty, and spent about $1.8 million on ads, according to the Center for Public Integrity.
Wecht, son of famed forensic pathologist Cyril Wecht, campaigned on a platform of transparency, saying he wanted to have cameras in courtrooms and a ban on gifts to judges, among other pledges.
Speaking after a victory party in Pittsburgh, Wecht said he was "humbled by the confidence of the people of Pennsylvania."
"I appreciate the confidence that the voters have shown in me," he said. "I will aim to serve them well. I am focused on law - I am not focused on nonsense."
Donohue, 62, another Superior Court judge from Allegheny County, also pledged to return integrity to the court, citing her 35 years of experience and her familiarity with judicial ethics.
The three Democrats beat out Covey, a Commonwealth Court judge from Bucks County; Olson, a Superior Court judge from Allegheny County; and George, president judge of Adams County.
Independent candidate Panepinto, a Philadelphia Common Pleas judge, also competed.
There was at least one indication Tuesday that Dougherty's fortunes were bright.
While several voters at the Christy Rec Center in West Philadelphia seemed indifferent toward candidates for mayor and City Council, Dougherty appeared to have by far the most name recognition.
Donohue, speaking from a gathering of about 100 friends and supporters at her Pittsburgh-area home, said after the results that Tuesday was "a fabulous night."
"I'm so honored and humbled by this opportunity that's been afforded to me," she said in an interview. "To serve on the Pennsylvania Supreme Court, and to really make it the court that it always should have been - one that's full of integrity and honor."
Inquirer staff writers Samantha Melamed and Caitlin McCabe contributed to this article.