Democratic Rep. Al Wynn and Republican Rep. Wayne Gilchrest were unseated Tuesday by primary challengers to the left and right respectively.

Both lawmakers have been in office for many years -- Wynn is serving his eighth term, Gilchrest is on his ninth.

Voters registered dissatisfaction with both congressmen over their votes on Iraq -- Wynn for his initial support for the war he later opposed and Gilchrest for his vote for a timetable to withdraw. He had originally voted in 2002 to authorize the United States to go to war in Iraq.

Challenger Donna Edwards, who ran many ads on suburban Washington television channels, also attacked Wynn for his support of 2005 bankruptcy reform legislation. The attorney and political activist said the bill exacerbated problems for homeowners facing foreclosure. Prince George's County, which Wynn represents, has the highest rate of foreclosures in Maryland.

It was Edwards' second go at Wynn's 4th District seat. In 2006, she lost by 3 percentage points in the majority black district that borders Washington.

Edwards had split with Wynn the backing of several unions and pro-choice organizations. The Washington Post endorsed Edwards, as it did in 2006.

Wynn called Edwards early Wednesday to concede the race, according to Edwards spokesman Dan Weber.

Wynn touted his 16 years in Congress, saying it would not be wise for voters to cast aside his experience in favor of Edwards. She has never held elected office.

Both candidates had endorsed Barack Obama in the presidential race. Obama has spread a message of change, which Edwards said applies to Congress as well.

Wynn is the first sitting member of Congress to lose this primary season, though Illinois is the only other state that held congressional and presidential primaries on the same day.

His loss was closely followed by the upset of Gilchrest by state Sen. Andy Harris in Maryland's 1st Congressional District.

Harris depicted Gilchrest as too moderate for the district, which includes the state's Eastern Shore and parts of the Baltimore suburbs.

"The voters of the 1st District apparently embraced my conservative message," Harris told supporters shortly after midnight Wednesday.

Gilchrest was particularly criticized for his vote a year ago for a timeline for withdrawal from Iraq. He was one of two Republicans in Congress to back a timeline.

Gilchrest had voted to go to war in Iraq but later said he regretted the decision and that President Bush bungled the war.

Meanwhile, the Club for Growth had supported Harris for his anti-tax positions in the state Legislature.

"Voters refused to settle for pork barrel spending and higher taxes when they had a taxpayer hero like Andy Harris to vote for," the watchdog group said in a statement after the results were announced.

Gilchrest called the campaign the most intense of his political career. He had earned Republican challengers just a few months after his last inauguration following a race he had won with 68 percent of the vote.

The congressman said he was proud of the fact that he had "ran a good campaign. We held on to our integrity," but is unlikely to concede the loss until provisional and absentee ballots are counted. Absentee ballots will be tallied Thursday, while provisionals will be counted Feb. 19.

Gilchrest scrambled in recent months to shore up support among Republican voters, appearing with GOP favorites such as former U.S. Speaker Newt Gingrich and presumptive presidential nominee John McCain.

The Associated Press contributed to this report.