The promise and the peril of Seth Williams first came into focus a dozen years ago, when he unsuccessfully challenged his onetime mentor in the 2005 Democratic primary for Philadelphia's district attorney.

Williams was ambitious, with fresh ideas to reinvigorate the office.

Williams was arrogant, with messy finances and unpaid bills.

That duality remained a constant even after he ultimately captured the office in 2009.

The  worst of it, Williams never outgrew.

A federal grand jury indicted Williams on Tuesday, accusing him of abusing his power as the city's top prosecutor to seek bribes to finance a high-flying lifestyle.

Williams' quest for a legacy as a reformer was crushed under the weight of his inability to live on a $175,572 annual salary.

Prosecutors allege Williams took bribes of airfare, vacations, a custom couch, a convertible Jaguar XK8, cash, and other valuables in exchange for helping two local businessmen, one of whom had a friend facing criminal charges and the other a felon in danger of losing a liquor license for a bar he owned in San Diego.

Those who saw Williams up close said the weaknesses described in the 23-count indictment — a taste for luxury, an obsession with the trappings of office, and a drive to please those with access to money and power — were there from the start.

The last two people who held the office before Williams, Lynne Abraham and former state Supreme Court Chief Justice Ronald D. Castille, once saw potential and problems for the young prosecutor who joined the District Attorney's Office in 1992.

"He was a go-getter," Abraham said Friday.

Castille, then on the state high court, swore in Williams as an assistant district attorney.

"I thought he was a pretty dynamic guy," Castille recalled. "He seemed like a hard charger."

But Abraham was troubled by how often she had to rein him, like a wayward child.

Williams, for instance, arranged regular Friday night gatherings for young prosecutors at the now-defunct nightclub Polly Esther's. Abraham told him to put a stop to the get-togethers, worried that one would end with a prosecutor getting a DUI — or worse.

"He was partying and dancing with girls, with a wife and child at home," she said. "It was not the right way to act."

Williams shrugged off her warnings, she said, his ego growing as he rose through the ranks.

"He was not devoted to doing his work," Abraham said, describing a big talker, bluffing his way along.

That "only carries you for so long," she said. "Then you have to have talent, hard work, and ethics."

Williams left the DA's Office in 2003. He sent Abraham an adoring farewell letter, calling her "Mama Lynne," and invited her to his farewell party. There, in a shocking betrayal, he announced to a roomful of prosecutors — and Abraham — that he planned to run against her in two years.

Not unexpected, that race was ugly. Williams accused Abraham of reneging on a promise to step aside in favor of him in 2005. She flatly denied it. Then she beat him with nearly 56 percent of the Democratic primary election vote.

Abraham decided not to seek  reelection in 2009.  Williams prevailed in a five-candidate primary and easily won the general election.

He charged into office with an ambitious agenda of reforms, including being more selective in the cases and charges pursued. He pushed through a radical restructuring that saw prosecutors assigned to specific neighborhood courts rather than fielding cases all over the city.

But there were signs of trouble for the new DA, who enjoyed the comforts of the Union League,  the private retreat of the city's business elite.

"I'd go over to the Union League and see him there all the time smoking cigars with the bigwigs there," Castille said. "There's nothing wrong with that, but the people that hang out over there are not shy about asking the district attorney to do something for them."

His political action committee became a go-to fund for good times. Williams reported spending nearly $29,000 from that fund at the Union League in 2014 for dues, meals, and a campaign fund-raiser. He spent nearly $19,000 there in 2015, the year subpoenas arrived from the grand jury examining his finances.

About the same time, he  had trouble paying his gas bill and was sued in Municipal Court in 2012 for not paying his Lowe's credit card.

Williams stands accused of illegally raking in $54,465, including $34,145 in bribes and $20,319 in money that was meant to pay for his mother's care in a nursing home.

Family finances were a problem even as Williams sought elected office.  His then-wife, Sonita, filed for bankruptcy during his 2005 campaign, leaving his name off the petition that cited $71,000 in credit-card debt.

His campaign that year made $12,707 in payments to his wife. An additional $9,762 in campaign funds went to her in 2008.

Seth and Sonita Williams, who have three children, announced their divorce in 2011. In public comments made in 2016, he blamed the divorce for his money troubles.

Few people in Philadelphia's political world have followed the arc of Williams' career as closely as State Sen. Anthony Hardy Williams. The future district attorney interned for Williams when he was a state representative in the early 1990s.

"I've heard a lot of rumors for the last two years about an indictment," the senator said Tuesday.

The senator, like others who have been close to the district attorney, struggled to reconcile the allegations that dogged him with the man he knew to be kind and thoughtful. On the one hand, "Seth was and is an extraordinary story," Williams said, a reference to the heights he rose to after being adopted as a 2-year-old by Imelda and Rufus Williams.

But Sen. Williams also read the text-message exchanges in the 50-page federal indictment that show his old friend soliciting trips and gifts from area businessmen. "It made my stomach go to my toes," he said. "I think about how hard it must have been to sit with his children and explain this information. It's painful on a lot of levels." ​

Another old friend is former State Rep. Louise Williams Bishop, who still broadcasts a popular Sunday morning gospel radio show. Williams claimed Bishop, like Abraham, as a mentor in his rise to elective office.

Bishop factored into a vicious showdown Williams had with another prosecutor on the rise, former state Attorney General Kathleen G. Kane.

The Inquirer in 2014 revealed that Kane, after taking office, had shut down a bribery investigation in that office that had focused on six Philadelphia Democrats, five state representatives and a Traffic Court judge.

In a show of bravado, Williams promptly vowed to pick up the cases and pursue charges with a local grand jury. Among his targets was his "mentor" Bishop.

"I will not and cannot look the other way just because you are my friend or a member of my political party or my race," Williams said about Bishop, who eventually pleaded no contest to a misdemeanor and resigned.

Bishop recalls Williams as "always ambitious," a young man who was friends with her daughter but not quite the protege he portrayed himself to be.

"I always thought of him as very smart and going to the top of whatever field he chose," she said.

Bishop says she is not bitter about Williams' decision to prosecute her. And she is "mystified" that he is now the defendant in court.

"I don't know if anyone saw that coming," she said. "I don't even know what caused that."

Thomasine Tynes, once a judge on the city's former Traffic Court, was also pursued by Williams in what became known as the "sting" case.

Tynes, who was also prosecuted in federal court for unrelated corruption charges in Traffic Court and then spent time in prison, said she, too, is not bitter toward Williams.

"I feel sorry for him, I really do," she said. "I think once people get power ... you just sometimes get confused about right and wrong, what you can do and cannot do."

Tynes considers herself "collateral damage" in the public feud between Williams and Kane. She pleaded guilty to a charge of conflict of interest in the case Williams filed, for accepting a $2,000 Tiffany bracelet.

"I got caught up in this," she said. "Kathy Kane and him, she went after him, he went after her. And now they're both in trouble."

Kane was convicted in Montgomery County in August on charges of perjury, obstruction of justice, and other crimes after a jury found that she had leaked secret grand jury material to the Daily News.

Black Lives Matter activists are planning to gather in front of the District Attorney's Office on Monday morning to call for Williams' resignation, a scene that would have been hard to imagine when he won his first term in 2009.

"He was the great black hope. Everyone rallied around him. We wanted him to succeed and make changes that would affect us," said Asa Khalif, the president of the Pennsylvania chapter of Black Lives Matter.

But Khalif argued Williams' support in minority communities has all but evaporated, mirroring the backing he lost from the Fraternal Order of Police Lodge No. 5 along the way.

When Williams appeared in federal court last week to enter a not-guilty plea, Khalif said, he was struck by an unlikely thought: "The police and Black Lives Matter were actually on the same page for the first time. We had the same common enemy: Seth." ​