Congresswoman Debbie Wasserman Schultz of Weston was supposed to be beginning one of the best weeks of her political career. Instead, she announced Sunday that she was resigning as chairwoman of the Democratic National Committee.

Everything unraveled for Wasserman Schultz over a tumultuous 48 hours after WikiLeaks posted a treasure trove of emails. The emails became a major distraction for Hillary Clinton's presidential campaign and a political nightmare for Wasserman Schultz as the Democratic National Convention prepared to convene Monday.

She announced her departure — which she said would go into effect at the end of the convention — after a day in which the Sunday TV political shows and cable television news were filled with speculation about her future. She said she wanted to continue serving South Florida in the U.S. House "for years to come" and doing whatever she could to see Clinton elected president.

"Going forward, the best way for me to accomplish those goals is to step down as party chair at the end of this convention. As party chair, this week I will open and close the convention and I will address our delegates about the stakes involved in this election not only for Democrats, but for all Americans," Wasserman Schultz said.

Less than a half our after Wasserman Schultz announced her departure, Clinton released a statement filled with praise.

"I want to thank my longtime friend Debbie Wasserman Schultz for her leadership of the Democratic National Committee over the past five years. I am grateful to Debbie for getting the Democratic Party to this year's historic convention in Philadelphia, and I know that this week's events will be a success thanks to her hard work and leadership. There's simply no one better at taking the fight to the Republicans than Debbie," Clinton said.

She offered some face-saving comments for Wasserman Schultz, that she'll serve as "honorary chair" of the Clinton campaign's effort to elect Democrats and said she'd serve as a Clinton campaign surrogate.

President Barack Obama also publicly praised Wasserman Schultz, who he said "has had my back."

"Her leadership of the DNC has meant that we had someone who brought Democrats together not just for my re-election campaign, but for accomplishing the shared goals we have had for our country," Obama said in a statement, adding that "she will always be our dear friend."

(Anthony Man) (Anthony Man)

Republican presidential nominee Donald Trump took to his favorite forum — Twitter — to gloat about Wasserman Schultz's downfall.

"Today proves what I have always known, that [Republican National Chairman] Reince Priebus is the tough one and the smart one, not Debbie Wasserman Schultz," Trump tweeted. "I always said that Debbie Wasserman Schultz was overrated. The Dems Convention is cracking up and Bernie is exhausted, no energy left!"

Sanders supporter Ben Jealous, former president and CEO of the NAACP, welcomed Wasserman Schultz's departure. "This is great," he said on CNN.

Wasserman Schultz's undoing came after the emails provided insights into her and the operations of the Democratic Party. They show Wasserman Schultz's fury over a cable television host's call for her ouster as DNC chairwoman. They reveal her contempt for the manager of Bernie Sanders presidential campaign. And on a personal level, they show her desire for a block of coveted seats to Broadway's hottest show.

More broadly, the emails show that party personnel favored Clinton throughout the presidential primary campaign against Sanders. Sanders and his supporters complained for months that the DNC was tipping the scales in Clinton's favor — something Wasserman Schultz repeatedly denied.

Sanders was critical of the Florida congresswoman throughout the primary, accusing the party of rigging the process in favor of Clinton.

During appearances on several political television shows on Sunday, Sanders said the emails validate what he's been saying for months. "What I suggested to be true six months ago turns out in fact to be true," Sanders said on ABC. "I'm not shocked but I am disappointed."

Later Sunday, Sanders said in a statement that Wasserman Schultz "has made the right decision." He said she "deserves thanks for her years of service."

The email release was a problem for the Clinton campaign because it dominated political conversation just as the national convention is getting underway. The Clinton camp had to spend Sunday answering questions about it instead of her newly picked running mate and convention beginning Monday in Philadelphia.

For Wasserman Schultz, the emails were a political disaster. Clinton campaign manager Robby Mook, making the rounds of the Sunday political TV shows was faced with repeated questions about Wasserman Schultz, which he repeatedly avoided.

Sanders appeared on the same programs to repeat his months-old call for her resignation. "Many, many months ago, I made clear that Debbie Wasserman Schultz should resign, should step down," Sanders said on "State of the Union" on CNN. "Not only because of the prejudice I think they showed during this campaign but also because I think we need a new leadership for the Democratic Party."

Writing on Facebook, prominent liberal Democrat Robert Reich said the emails show why Wasserman Schultz should be fired "now. Don't wait." Reich was labor secretary in former President Bill Clinton's cabinet.

Wasserman Schultz got the job from Obama in 2011. Her term was supposed to end on Jan. 20, 2017, the day the next president will be inaugurated. Democrat and CNN commentator Donna Brazile is expected to finish the term.

Wasserman Schultz weathered previous rounds of criticism, but the latest firestorm was too hot for her to withstand. It started simmering on Saturday and built Sunday until Wasserman Schultz announced her plan to step down shortly before 4 p.m.

The Clinton campaign wanted to prevent a continuing story, fueled by reactions from Sanders supporters, that could come from a continuing role for Wasserman Schultz. The early days of last week's Republican convention were consumed by cable television talk about the parts of the speech by Melania Trump, wife of the presidential candidate, that were lifted from Michelle Obama's speech to the 2008 Democratic convention.

There was a hint on Saturday of what a Wasserman Schultz appearance before a big Democratic crowd could bring on a much larger scale. She gave the final warm-up speech, receiving enthusiastic applause, at Clinton's rally at Florida International University in west Miami-Dade County.