WASHINGTON — On a day of pomp and pageantry, ebullient Democrats assumed control of the House on Thursday and elected Representative Nancy Pelosi of California to be speaker, returning her to a historic distinction as the first woman to hold the post at the pinnacle of power in Congress, second in line to the presidency.
The investiture of Ms. Pelosi, whose talent for legislative maneuvering is surpassed only by her skill at keeping her fractious party in line, placed her at the fulcrum of divided government opposite an increasingly combative President Trump. With Mr. Trump, his presidential campaign and his businesses all under federal and state investigations, her handling of him will likely define the 116th Congress.
Her election came on Day 13 of a government shutdown that has dramatized the shifting dynamics in Washington. Mr. Trump’s insistence on a wall on the Mexican border has come to embody harsh immigration policies that will run headlong into newly energized Democratic opposition.
But on Thursday, if only for a few hours, the dark clouds of divisive politics parted long enough for a peaceful transition of power from Republicans to Democrats, as a majority of lawmakers rose in turn from their seats on the House floor to utter Ms. Pelosi’s name and formally award her the gavel she relinquished in 2011 after a Tea Party wave swept Republicans to power.
Following her election, Ms. Pelosi, wearing a hot pink dress, ascended to the marble dais in the center of the House chamber with Representative Kevin McCarthy of California, the incoming Republican leader, who handed her the wooden gavel.
“To the speaker of the House, Ms. Pelosi, I extend to you the gavel,” he said. The room erupted into applause as Ms. Pelosi held the tool aloft, showing it off to her colleagues.
“Our nation is at a historic moment,” she declared. “This Congress will be bipartisan, transparent and unified.”
Meet the New Freshmen in Congress Being Sworn In Today
The congressional freshman class of 2019 includes the most racially diverse and most female group of representatives ever elected to the House.
Moments later, with a “Come on, kids!” Ms. Pelosi invited the children and grandchildren on the floor of the House to surround her as she took the oath of office.
“I now call the House to order on behalf of all of America’s children,” Ms. Pelosi said after she was sworn in.
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.
“When our new members take the oath, our Congress will be refreshed, and our democracy will be strengthened by the optimism, idealism and patriotism of this transformative freshman class,” Ms. Pelosi said. “Working together, we will redeem the promise of the American dream for every family, advancing progress for every community.”
Representative Hakeem Jeffries of New York, the chairman of the House Democratic Caucus, nominated Ms. Pelosi to be speaker, prompting a standing ovation from most of the Democratic side of the House and many of the spectators in the gallery.
In nominating Ms. Pelosi in a rousing speech, Mr. Jeffries 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.,” Mr. Jeffries said, using Ms. Pelosi’s initials.
But Ms. 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, Ms. 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 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 and Jared Golden of Maine, as well as Representatives Jim Cooper of Tennessee, Ron Kind of Wisconsin, Conor Lamb of Pennsylvania, Kurt Schrader of Oregon, and Kathleen Rice of New York.
Many of the newly elected members had campaigned calling for change in Washington and a new generation of leadership for their party, and promising not to vote for Ms. Pelosi as a result. As part of a final deal to shore up support, Ms. Pelosi agreed to limit her speakership to four years.
But two of the ringleaders of the squelched effort to depose Ms. Pelosi, Representatives Seth Moulton of Massachusetts and Tim Ryan of Ohio, ultimately voted for her.
With her re-election, the biggest Republican super PAC — and the one that arguably tried hardest in 2018 to tie Democratic candidates to Ms. Pelosi — practically celebrated. “Democratic candidates spent the last two years promising voters that they’d be different — they wouldn’t stand for the same old leadership and the same old way of doing business in Washington,” the Congressional Leadership Fund said in a statement. “Yet with the very first chance they got, they broke their word and their bond with the voters who elected them.”
The National Republican Congressional Committee, the party’s House campaign arm, wasted no time in targeting Democrats in competitive districts who voted for Ms. Pelosi, sending voters in their districts text messages immediately following the roll-call saying that their representatives “are once again ignoring your voice.”
“Ann Kirkpatrick voted for Nancy Pelosi as speaker after promising you she would not on the campaign trail,” read one such message sent to voters in Ms. Kirkpatrick’s Arizona district. “Fight back NOW!”
Ms. Pelosi became the first person since Representative Sam Rayburn of Texas, more than 60 years ago, to reclaim the position of House speaker.
Even as Ms. Pelosi broke historical barriers, the spirit of a new generation of Democrats was in evidence in the well of the House on Thursday. Several lawmakers bounced or rocked infants as they cast their votes for speaker, while Representative Alexandria Ocasio-Cortez of New York, at 29 the youngest person to be elected to the House, made a heart sign with her hands — a millennial-approved gesture of affection — at loved ones in the House gallery above. Representative Rashida Tlaib voted for Ms. Pelosi for the “future of our children,” she said, while her own two children dabbed beside her.
For Ms. Pelosi, who learned her particular brand of hyper-disciplined, passionate and relationship-driven politics at the knee of her father Thomas d’Alesandro Jr., a Baltimore congressman and later mayor, it was the culmination of a remarkable career that began when she was a mother and activist in her San Francisco home and ultimately took her to the highest post in Congress. Several of her colleagues made reference to her personal story as they cast their votes on Thursday, uttering the name “Nancy d’Alesandro Pelosi.”