Nancy Pelosi was elected speaker for the 116th Congress today, cementing her legacy and returning the longtime Democratic leader to the post she first held eight years ago.

Pelosi, the first and only woman to ever wield the speaker’s gavel, received 220 votes out of the 430 votes cast.

As speaker, Pelosi will be the most prominent Democratic foil to President Trump and second in line to the presidency.

“Two months ago, the American people spoke, and demanded a new dawn,” Pelosi said in a speech after winning the gavel. “I am particularly proud to be the woman speaker of the House of this Congress, which marks 100 years of women winning the right to vote.”

The GOP, which saw a significant decrease in the number of Republican women after the 2018 election, was represented mainly by white men in dark suits.

The Democratic side, meanwhile, welcomed a historic number of female members, many of them clad in bright pops of pink, purple, green and red.

Scores of newly elected Democrats in the most racially, ethnically and gender-diverse class in history were on hand for the occasion, some of them clad in the traditional or religious garb of their communities — a Palestinian thobe, a Muslim hijab or head scarf, a Pueblo dress.

The new members provided the visual tableau of change in a chamber that has for centuries been overwhelmingly white and male.

Many House Democrats wore bright blue buttons next to their traditional member’s pin adorned with the words “Madame Speaker” in bold white letters.

And several lawmakers were seen toting their young children around the House as they welcomed new members and said hello to longtime colleagues.

Pelosi, clad in a bright pink dress, entered the chamber with several of her grandchildren in tow, pumping her fists as she walked down the center aisle of the chamber.

The election marks a triumphant return to the gavel for the California Democrat after a band of a dozen-plus rebels unsuccessfully tried to deny her the speakership late last year.

Fifteen Democrats defected in the vote, with twelve casting votes for other people and three voting “present.”

Pelosi is the first person in six decades to regain the speaker’s gavel after losing it, a job she first held from 2007-2011.

This time around, Pelosi will ascend to the speakership in the middle of a partial government shutdown with no end in sight.

Still, even with the shadow of the shutdown looming over the new Congress, current and incoming lawmakers exuded that “first day of school” vibe.

In nominating Pelosi in a rousing speech, Representative Hakeem Jeffries of New York, the chairman of the House Democratic Caucus, extolled her as “a woman of faith, a loving wife a mother of five, a grandmother of nine, a sophisticated strategist, a legendary legislator, a voice for the voiceless, a defender of the disenfranchised, a powerful, profound, prophetic, principled public servant.”

“House Democrats are down with N.D.P.,” Jeffries said, using Pelosi’s initials.

But Pelosi’s election was not without dissent.

Having spent more than 15 years at the helm of her party and been demonized by Republicans during the midterm congressional election as the ultraliberal face of far-left radicalism, Pelosi, 78, spent the weeks after Democrats won putting down a rebellion over her leadership in Democratic ranks and consolidating support through a combination of deal-cutting and cajoling.

She suffered more than a dozen Democratic defections:

Freshman Representatives Anthony Brindisi of New York

Jason Crow of Colorado

Joe Cunningham of South Carolina

Ben McAdams of Utah

Max Rose of New York

Mikie Sherrill of New Jersey

Elissa Slotkin of Michigan

Abigail Spanberger of Virginia

Jeff Van Drew of New Jersey

Jared Golden of Maine

Jim Cooper of Tennessee

Ron Kind of Wisconsin

Conor Lamb of Pennsylvania

Kurt Schrader of Oregon

Kathleen Rice of New York.

Pelosi has a clock ticking on her power after cutting a deal with Democratic rebels in December to clinch the votes she needed to become speaker.

As part of the deal, Pelosi agreed to limit herself to two more terms at most.

And if she decides to run for speaker in 2020, she must receive the backing of two-thirds of the caucus, a higher threshold than the simple majority she had to clear this time.