Conor Lamb, right, with House Speaker Paul D. Ryan during a mock swearing-in at the Capitol on April 12. Lamb later took the official oath of office. (Andrew Harrer/Bloomberg News)

Democrat Conor Lamb became the newest member of the House of Representatives on Thursday, sworn in by retiring House Speaker Paul D. Ryan (R-Wis.) after a failed vote on a balanced-budget amendment to the Constitution.

“The founding creed of our country holds that we are endowed by our creator,” Lamb said in a short floor speech. “Our rights do not come from the state, but from the hand of God.”

A few Republicans applauded those remarks, and Lamb went on to say that voters in Pennsylvania’s 18th District maintained a “faith in America and a fierce determination to make our institutions work again.” After he wrapped up, the 115th Congress’s newest member stood for more than five minutes, shaking hands with colleagues.

House Minority Leader Nancy Pelosi (D-Calif.), whom Lamb has said he will oppose if she seeks another term in the leadership, greeted him briefly; Rep. David B. McKinley (R-W.Va.), whose district borders Lamb’s, and Rep. Carlos Curbelo (R-Fla.) were among the Republicans who joined the scrum. Later, Pelosi announced that Lamb, a Marine veteran, would be appointed to the Veterans’ Affairs Committee and the Committee on Science, Space and Technology.

“Congressman Conor Lamb’s swearing-in is good news for all of America’s hard-working men and women,” Pelosi said in a statement.

Lamb’s path to Congress was relatively short and got plenty of national attention. He declared his candidacy just six months ago, after former congressman Tim Murphy (R) resigned in disgrace. Lamb quickly consolidated support from Democrats, and Republicans grew nervous about their chances of holding the seat after the local party nominated Rick Saccone, a conservative state representative who had been elected in the 2010 tea party wave.

The pricey special election that followed pulled leaders of both parties into the district. President Trump made two visits to the Pittsburgh-area district, and every major Republican committee invested in ads and get-out-the-vote efforts. Lamb, whose family was well known in local politics, raised $3.9 million and won a tight race. He declared victory on election night, before Saccone had conceded, when unofficial results had Lamb leading by 627 votes. In the following weeks, absentee ballots, military ballots and corrected vote counts raised his margin to 755 votes.

The 18th District, as drawn in 2011, will cease to exist this year. Lamb is running for a full term in the new 17th District, which ties together some of Pittsburgh’s suburbs with conservative Beaver County. The old 18th District backed Trump by 20 points; the new 17th, represented by Rep. Keith Rothfus (R), backed Trump by just three points. The Cook Political Report has rated the new district as a “toss-up.”