Moderate U.S. congressman Kurt Schrader of Oregon, who at times angered fellow Democrats by opposing pieces of President Joe Biden's agenda, has been defeated by left-wing primary challenger Jamie McLeod-Skinner.

The Associated Press called the race on Friday for McLeod-Skinner, who ousted the seven-term incumbent and moderate who had been endorsed by Biden.

"Schrader has been a valued and independent voice," U.S. House Speaker Nancy Pelosi said in a statement that also congratulated McLeod-Skinner.

McLeod-Skinner welcomed the victory in a post on Twitter, saying "Oregonians never stopped believing we can protect our families, our climate and our civil rights."

The vote was one of several nominating contests ahead of the Nov. 8 general election in which members of the Democratic Party's left flank are seeking to oust moderate rivals from the House of Representatives.

The House district Schrader represents in Oregon leans Democratic, according to independent election forecasters.

He drew the ire of some Democrats back home when he called former President Donald Trump's second impeachment by the House in 2021 a "lynching," voted against the initial passage of Biden's COVID-19 relief package, and pushed to shrink the president's Build Back Better social spending bill that eventually failed in the Senate.

Even so, Biden endorsed Schrader's bid for an eighth two-year term in the House, saying in April: "We don't always agree, but when it has mattered most, Kurt has been there for me."

Schrader, a farmer and veterinarian first elected to the House in 2008, has said he voted with Biden 96% of the time and represented Oregon's independent and Republican voters as well as its Democrats. Representatives for the congressman could not be immediately reached for comment.

McLeod-Skinner, a lawyer and school board member, was endorsed by prominent progressive U.S. Senator Elizabeth Warren, as well as the local Democratic party organizations in four counties representing 90% of the district's population, an unusual move.

McLeod-Skinner criticized Schrader for his voting record, accusing him of voting against Democratic priorities.