Larry Krasner was the unlikeliest of candidates for district attorney in Philadelphia.
That turned out to be just the ticket for victory in the unlikeliest of Democratic primary elections Tuesday.
Progressive voters demanded reform for an office currently held by a man under federal indictment. And the local race was nationalized by a growing sense of resistance among many Democrats in the city to President Trump's every move.
Krasner, 56, easily defeated six other contenders Tuesday, in a campaign that went from low-key to high-profile last month with a $1.45 million investment from billionaire George Soros in a pro-Krasner independent political action committee.
With nearly 98 percent of the vote tallied Tuesday night, Krasner held nearly an 18-point lead on his closest Democratic rival.
Krasner will face in the Nov. 7 general election Beth Grossman, the lone Republican in her party's primary Tuesday.
Krasner, a defense attorney for three decades best known for taking on civil rights cases for Black Lives Matter and Occupy Philadelphia members, AIDS activists and protesters arrested at political conventions, has never served a day in his career as a prosecutor.
That became his pitch — that he was more likely to reform the District Attorney's Office because he had no ties to the institution, unlike most of the other Democrats in the race.
That message appealed to several hundred people who filled the John C. Anderson Apartments community room and an outdoor courtyard in Center City on Tuesday night for Krasner's victory party.
It got a little rowdy as the results rolled in.
Chants of "No good cops in a racist system" and against the Fraternal Order of Police were quickly shut down by Krasner campaign staffers.
Krasner, who lives in West Mount Airy, told the crowd they shared a vision of "a criminal justice system that makes things better, that is just, that is based on preventing crime and is based on building up society rather than tearing it apart."
And he reached out to the office he hopes to lead.
"To the good people of the District Attorney's Office, I want you to know, you could have made more doing something else, but you became district attorneys because you wanted justice," he said. "You know what I want? I want what you want. I want justice."
Krasner had a remarkable impact on the primary, pulling the field to the left, leading that movement with a pledge to stop seeking death-penalty sentences if elected.
He joked Tuesday night that his position on capital punishment had been described as "political suicide."
As he ended his speech, the crowd launched into a booming chant of "This is what democracy looks like."
Krasner's primary victory is certain to set off rumblings of uncertainty in the District Attorney's Office.
He has described it as "a place with a mad zeal for the highest charge, for the highest level of conviction, a culture that can find no flaw in police misconduct, that is drunk on the death penalty."
Krasner has also sued law enforcement agencies or the government more than 75 times.
His rise prompted a group of two dozen former District Attorney's Office employees to endorse former city and federal prosecutor Joe Khan on Friday.
Khan finished second in the race, followed by former city Managing Director Rich Negrin, former First Assistant District Attorney Tariq El-Shabazz, former city and state prosecutor Michael Untermeyer, former assistant district attorney Jack O'Neill, and former Municipal Court Judge Teresa Carr Deni.
Krasner, the son of a crime-fiction author and an evangelical Christian minister, grew up in St. Louis and graduated from Stanford Law School, starting his career as a federal public defender before launching his own firm in 1993.
He is married to Common Pleas Court Judge Lisa M. Rau.
Krasner's victory was fueled by biographical television commercials paid for with Soros' cash. That helped him far outpace Untermeyer, who invested $1.3 million of his own money in the race, and Khan, who outperformed all the other candidates in fund-raising from individual donors.
Negrin, expected to have the advantage of name recognition in the city and the first position on Tuesday's ballot, ran a campaign that never caught fire.
El-Shabazz seemed unprepared for the scrutiny of politics and stumbled when questioned about thousands of dollars in city, state and federal tax liens for himself and his law firm.
O'Neill, though pushed by many of the city's politically influential building trades unions, ultimately drew little support, as did Deni.
In the coming general election race against Grossman, Krasner will enjoy an advantage in resources and registration. Grossman's most recent campaign finance report showed she had $3,786 in the bank as of May 1, after lending her campaign $25,500.
And Philadelphia's registered Democratic voters outnumber Republicans 7-1.
Grossman, 49, was an assistant district attorney for 21 years and served as chief of the Public Nuisances Task Force.
Grossman, who lives in East Falls and attended Temple University's School of Law, said she plans to contrast her record in the office to Krasner's lack of experience as a prosecutor.
The District Attorney's Office has about 560 employees, including about 300 lawyers, and a projected budget of $54 million for the fiscal year that starts July 1.
"I got tired of a very damaged local Democratic Party that has ethical problems," she said. "Too many people have been investigated, indicted and convicted."
Seth Williams, the current district attorney, is scheduled to start his federal trial next month.
Williams appeared assured to win a third term until the news broke in 2015 that the FBI and IRS, working with a federal grand jury, had subpoenaed financial records from his political action committee.
Williams dropped out of the Democratic primary election in February and was indicted in March, accused of taking bribes from two businessmen and stealing money meant for the care of his elderly mother. Federal prosecutors added more charges last week, accusing him of using his political action committee to pay for personal expenses at private clubs.