Seth Williams was a prosecutor Joe Khan respected when they worked together at the Philadelphia District Attorney's Office.

But Khan, who left that office in 2006 to work for the U.S. Attorney's Office in Philadelphia, says he has seen a troubling change in Williams since he was elected district attorney in 2009.

Khan, who left his job as a federal prosecutor on Sept. 6, will declare his candidacy Thursday in the 2017 Democratic primary election for district attorney, challenging Williams' bid for a third term.

Central to Khan's candidacy is restoring integrity to the District Attorney's Office, which has been buffeted with criticism as federal investigators probe Williams' personal, political, and nonprofit finances.

"He was someone who actually had some good ideas," Khan said of Williams. "That person who came into office seven years ago is a very different person today. He has really lost his way."

Dan Fee, a spokesman for Williams' reelection campaign, said the district attorney is proud of his record in office.

"Integrity is central to the work performed each day at the District Attorney's Office and will continue to remain so in the future," Fee said in an email. "He looks forward to discussing his record and agenda for a third term with whoever decides to run."

Williams has been under the glare of public scrutiny for more than a year, after the Inquirer in August 2015 reported that federal prosecutors had subpoenaed records from the political action committee he used to run his campaigns for public office.

That glare turned more intense last month, when Williams amended his statements of financial interests for 2010 to 2015, listing $160,050 in previously unreported gifts.

And the FBI served a subpoena last month for financial records from the Second Chance Foundation, a nonprofit Williams founded in 2011.

Khan sees Williams' troubles as self-inflicted.

"What I have heard from all corners in the criminal justice system is that this is not a district attorney who encourages people to challenge his thinking," Khan said. "If you want to run a bad district attorney's office, the best way is to hire a bunch of yes-men or to govern by fear."

Fee, in his email, pushed back against Khan's claims, saying Williams has "well-established procedures for making important decisions" that include soliciting advice and input from people with expertise.

"It's an oddity of life: Some people who don't get their way confuse that with not being listened to," Fee wrote.

Khan's wife, Jessica, recently left her job at the District Attorney's Office, where she worked in the law division, defending convictions when they were appealed. She is now a law clerk for a judge.

"When we decided this was something I was going to commit to, we both left our jobs to make that possible," he said.

Khan left the U.S. Attorney's Office after a string of guilty pleas in a wide-ranging pay-to-play federal investigation that has reached the highest levels of government in Allentown and Reading, along with implicating political operatives and other public officials.

It could make for solid political fodder in a contest against an incumbent facing his own federal scrutiny. For now, there isn't much Khan can say about the ongoing investigation.

"I'm extremely proud of what we were able to accomplish while we were there," said Khan. "It was obviously really hard for me to leave behind a job that I loved."

Khan, 41, grew up in Bustleton and attended Central High School - eight years behind Williams - before attending Swarthmore College. He was a White House intern between college and attending the University of Chicago Law School.

He and his wife now live in Roxborough with their two sons, ages 2 and 4.

"This is absolutely not an easy time in a person's life to do anything, let alone run for public office," Khan said. "But this city needs a change. And I'm ready to provide that change and step up."