The 116th Congress gaveled into session Thursday swathed in history, returning the first woman to the House speaker’s office and ushering in a diverse class of Democratic freshmen ready to confront President Donald Trump in a new era of divided government.

The new Congress is like none other. There are more women than ever before, and a new generation of Muslims, Latinos, Native Americans and African-Americans in the House is creating what academics call a reflective democracy, more aligned with the population of the United States. The Republican side in the House is still made up mostly of white men, and in the Senate Republicans bolstered their ranks in the majority.

In a nod to the moment, Nancy Pelosi, the Democratic leader, was broadly pledging to make Congress work for all Americans — addressing kitchen table issues at a time of deep economic churn — even as her party is ready to challenge Trump with investigations and subpoena powers that threaten the White House agenda. It’s the first new Congress to convene amid a partial government shutdown, now in its 13th day over Trump’s demands for money for a wall along the U.S-Mexico border.

“This House will be for the people,” Pelosi was to say in remarks after winning the gavel, according to excerpts released ahead of time, “to lower health costs and prescription drugs prices, and protect people with pre-existing conditions; to increase paychecks by rebuilding America with green and modern infrastructure — from sea to shining sea.”

Pelosi vowed “to restore integrity to government, so that people can have confidence that government works for the public interest, not the special interests.”

The day was unfolding as one of both celebration and impatience. Newly elected lawmakers arrived, often with friends and families in tow, to take the oath of office and pose for ceremonial photos. The Democrats planned to quickly pass legislation to re-open the government, but without the funding Trump is demanding for his promised border wall.

Vice President Mike Pence swore in newly-elected senators, but Senate Republicans under Majority Leader Mitch McConnell had no plans to consider the House bills to fund the government unless Trump agrees to sign them into law. That ensures the shutdown will continue, clouding the first days of the new session.

It’s a time of stark national political division that some analysts say is on par with the Civil War era. Battle lines are drawn not just between Democrats and Republicans but within the parties themselves, splintered by their left and right flanks.

Pelosi defied history in returning to the speaker’s office after eight years in the minority, overcoming internal opposition from Democrats demanding a new generation of leaders. She will be the first to regain the gavel since legendary Sam Rayburn of Texas in 1955.

Putting Pelosi’s name forward for nomination, Rep. Hakeem Jeffries of New York, the incoming Democratic caucus chair, recounted her previous accomplishments — passing the Affordable Care Act, helping the country out of the Great Recession — as preludes to her next ones. He called her leadership “unparalleled in modern American history.”

As speaker, she’ll face an early challenge from the party’s robust wing of liberal newcomers, including 29-year-old New Yorker Alexandria Ocasio-Cortez, who has risen to such prominence she is already known around the Capitol — and on her prolific social media accounts — by the nickname “AOC.” She said she’d cast a no vote on a new package of rules to govern the House.

Ocasio-Cortez and other liberals oppose the pay-as-you-go budget provisions in the rules package that would allow restrictive objections to any legislation that would add to federal deficits. They say such restraints would hamstring Democratic efforts to invest in health care, education and develop a Green New Deal of renewable energy infrastructure projects to fight climate change.

Republicans face their own internal battles beyond just the conservative House Freedom Caucus, but as they decide how closely to tie their political fortunes to Trump. GOP leader Kevin McCarthy’s name was put into nomination by his party’s caucus chair, Rep. Liz Cheney of Wyoming, the daughter of the former vice president. She said McCarthy knows “our rights come from God” and “government is not the source of our liberty.”

Many GOP senators are up for re-election in 2020 in states, including Colorado and Maine, where voters have mixed views of Trump’s performance in the White House.

Trump, whose own bid for 2020 already is underway, faces potential challenges from the ranks of Senate Democrats under Chuck Schumer. Trump had little to say early Thursday as the new Congress was convening, but he did tweet an attack on one of his likely presidential challengers, Sen. Elizabeth Warren of Massachusetts, mocking her claim to Native American ancestry.

The halls of the Capitol were bustling with arrivals, children in the arms of many new lawmakers. Rep. Emanuel Cleaver, D-Mo., opened the House prayer asking at “a time fraught with tribalism at home and turbulence abroad” that lawmakers “become the architects of a kindlier nation.”

Overnight, Democratic Rep-elect Ilhan Omar of Minnesota tweeted a picture with her family at the airport. She wrote, “23 years ago, from a refugee camp in Kenya, my father and I arrived at an airport in Washington DC. Today, we return to that same airport on the eve of my swearing in as the first Somali-American in Congress.”

AP Photo/Jose Luis Magana