Democrat Josh Shapiro, who campaigned on a promise to reform the state's criminal justice system, claimed victory late Tuesday over Republican John Rafferty in the race to become Pennsylvania's next attorney general.

With 91 percent of precincts reporting, Shapiro had led by about 5 percentage points over Rafferty. Shapiro said Rafferty had called him to concede.

"I am most humbled by the responsibility that lies ahead," Shapiro said with a hoarse voice as he took the stage at the Sheraton Valley Forge Hotel in King of Prussia before midnight. "While I'm incredibly proud of my Democratic roots, I look forward to being the attorney general for all Pennsylvanians."

The candidates, both from Montgomery County, both said they were the most qualified to clean up the office after the tumultuous tenure of former Attorney General Kathleen G. Kane, who fell in the last four years from a rising Democratic star to an embattled prosecutor and convicted felon.

Shapiro, 43, of Abington, promised during his campaign to become "the people's attorney general" and bring more fairness to the criminal-justice system. A lawyer and former state representative, Shapiro is serving his second term as chairman of the Montgomery County Board of Commissioners.

Rafferty, 63, a three-term state senator from Audubon who once worked as a deputy attorney general, vowed to remove politics from the Attorney General's Office and accused Shapiro throughout the campaign of using the office as a "stepping-stone" to another job.

Shapiro has said that, if elected, he would serve a full four-year term as attorney general.

The two candidates differed most starkly on gun control. Rafferty received an A- rating from the National Rifle Association for "opposition to gun control," while Shapiro said he supports universal background checks and other gun-control measures.

With more than 700 employees, the Attorney General's Office has broad reach in Pennsylvania, and has overseen some of the state's highest-profile investigations, including the case against serial sex-abuser Jerry Sandusky and corruption probes of legislators and their staffs. The winner will replace Bruce Beemer, who was appointed after Kane resigned in August.

In other races for Pennsylvania row offices, Auditor General Eugene DePasquale, a Democrat, was holding a sizable lead over Republican John Brown. The auditor general examines finances and performances of state agencies, school districts, and municipal pension plans.

And for treasurer, Democrat Joe Torsella had an equally wide margin over Republican Otto Voit.

The last elected treasurer also resigned after scandal and criminal charges. Democrat Rob McCord stepped down in 2015 before pleading guilty to federal corruption charges of attempting to shake down state contractors during his unsuccessful run for governor.

610-313-8116 @Lmccrystal