In her own words - at least according to an aide - LeAnna Washington was "the f--ing senator" who could do whatever she wanted.

Even after she was charged this year with ordering state Senate staff to plan her birthday party fund-raiser, the longtime Democrat representing Philadelphia and Montgomery Counties showed little remorse. She skipped some hearings, and when she did attend she seemed stoic - if defiant - shaking her head as a former staffer described her office as toxic.

On Thursday, Washington finally spoke. She pleaded guilty to conflict-of-interest charges, and then, choking back tears, told reporters in Norristown she was always known "to stand up for what I believe in and what is right."

Judge Steven O'Neill suggested that might change. As he ordered her to serve house arrest and repay the state, he told Washington that history would probably remember her for "how you left office - under this cloud."

Washington called the outcome the best for her constituents. But the deal also spares the 69-year-old senator jail time and preserves her pension.

She already lost a reelection bid this year and will resign effective Friday, said her lawyer, Henry E. Hockeimer Jr.

The brief hearing marked the first conviction of a legislator by Attorney General Kathleen G. Kane's office, and the downfall of a lawmaker who for two decades had represented the region in Harrisburg.

Under the deal, Washington pleaded guilty to felony conflict of interest and agreed to cooperate in other investigations. Prosecutors dropped a charge of felony theft, which if proved could have cost the senator her pension, and agreed to no jail time.

O'Neill ordered her to spend three months on home confinement, an additional 57 months on probation, and pay $200,000 in restitution. Senior Deputy Attorney General Susan DiGiacomo said the restitution covers the public money Washington was accused of stealing plus her legal fees that had been covered by the Senate.

Prosecutors alleged Washington used her staff to plan her annual birthday party campaign fund-raisers from 2005 to 2013, using up to $100,000 in taxpayer money for political gain.

A grand jury report said Washington berated her chief of staff when he questioned the propriety of ordering her staff to do political work on government time. "I am the f-ing senator, I do what the f- I want, and ain't nobody going to change me," she told him, according to his grand jury testimony. "I have been doing it like this for 17 years. So stop trying to change me."

DiGiacomo declined to discuss how Washington was cooperating with her office - part of the arrangement that's helping her keep her pension.

Based on Washington's salary and years of service, it appears she would be entitled to about $55,000 a year for the rest of her life. (Officials with the State Employees' Retirement System said they could not calculate members' pensions until after they retire.)

Washington is among 32 public employees charged with wrongdoing by the Attorney General's Office since Kane was inaugurated in 2013.

O'Neill said he wasn't privy to details of the cooperation arrangement. But in a harsh rebuke of Washington, he said other former legislators were serving jail terms for the same crime she committed.

He said he accepted the plea because he trusted the prosecutor's judgment, then used the platform to warn others engaged in the same behavior.

"Take notice," he said. "These very types of crimes have brought down people who were given public trust."

To Washington, the judge said her crimes not only ruined her own reputation but were ones "that will taint, that will cloud, that will obscure," the work of good legislators.