Correction: The article misstated the party affiliation of Anthony J. O’Donnell, minority leader in the Maryland House of Delegates. O’Donnell, who unsuccessfully challenged Rep. Steny H. Hoyer (D), is a Republican, not a Democrat. This version has been corrected.

Congresswoman Donna Edwards, who came out in support of John Delaney at Judith A. Resnik Elementary School gives him a hug goodbye as they head out to different pollling places Tuesday in Gaithersburg, MD. (Katherine Frey/The Washington Post)

Maryland’s congressional delegation emerged from Election Day looking much as it did before — except in the western part of the state, where Democrat John K. Delaney defeated Rep. Roscoe G. Bart­lett in a district redrawn to snatch the seat held by Bartlett for two decades.

“You have given me a wonderful privilege to serve my country, and I accept with great humility,” Delaney said in a speech in Potomac after Bartlett conceded defeat. “As a country, we have to confront our challenges . . . to work to restore opportunity for a broad number of Americans and put partisan bickering aside.”

Instead of seeking an 11th term in a familiar, mostly rural area that had been safe for years, Bartlett, 86, found himself fighting uphill on turf that dips into Washington’s suburbs and gives Democrats a numerical edge. Analysts had called him the nation’s most vulnerable Republican.

Also of interest was the campaign for U.S. Senate. Although early returns suggested that Sen. Benjamin L. Cardin (D) would fulfill projections of an easy win, Republican challenger Daniel J. Bongino appeared to be in a battle for second place with S. Rob Sobhani, a former GOP candidate who used his private fortune to power an independent campaign. But early returns gave Bongino the lead.

“Clearly, Senator Cardin has won the election,” Sobhani spokesman Sam Patten said. “The larger message is, we exceeded expectations in a race [that Sobhani] entered two months before the election.”

As voters cast ballots for the first time since the state’s congressional districts were redrawn by a Democratic-controlled legislature to produce a deeper shade of blue, all the incumbents but Bartlett cruised to victory Tuesday in House and Senate races.

In the 3rd District, Democratic Rep. John Sarbanes won reelection easily against Republican Eric D. Knowles and Libertarian Paul W. Drgos Jr. In the 4th District, Rep. Donna F. Edwards (D), who has acquired a reputation for bucking her party on issues such as the expansion of gambling, defeated Republican Faith M. Loudoun and Libertarian Scott Soffen.

Rep. Steny H. Hoyer (D), dean of the state’s delegation and its longest-serving member of Congress, sailed to another term representing the 5th District, where he faced Del. Anthony J. O’Donnell (R), who is the minority leader in the state House of Delegates, and two other challengers.

In the 8th District, Rep. Chris Van Hollen, the top Democrat on the House Budget Committee, dispatched Republican Ken Timmerman and two other challengers in his bid for a sixth term. “My overall impression is that there’s a lot more that unites these communities than divides them,” Val Hollen said after touring newer parts of his redrawn district.

But the most closely watched race pitted Delaney, a businessman from Potomac, against Bart­lett in a district now stuffed with Montgomery County Democrats. Bartlett, whose career has been as varied as it has been long, has held the Western Maryland seat since 1992 with little fuss. His mantra has been less government, whether discussing health care, education or defense.

With the intensity that helped him build two financial firms, Delaney first pulled off an upset victory over a primary candidate favored by Maryland’s Democratic power brokers. Then he led a disciplined, well-financed campaign that depicted Bartlett as out of touch and out of gas.

Delaney, 49, chairman and a co-founder of Chevy Chase-based CapitalSource, cast himself as a moderate Democrat whose ability to cut a deal in the world of finance would help him reach across the aisle in Congress. When Delaney talked about overhauling the economy, he sounded like someone who knows markets and trusts them, referring to himself as a “capitalist” during a debate. But he reminded voters that his path to becoming a multimillionaire began in the New Jersey home of an electrician whose union had put Delaney through college.

Delaney’s message hit home with Samuel Mok, who runs a consultant practice and lives in Montgomery. Although Mok disliked the gerrymandered district, he said he disliked Bartlett’s conservative politics even more.

“He doesn’t represent the interests of Montgomery County,” Mok, 60, said.

Delaney also spent a lot of his own money. On Oct. 31, he kicked in $250,000. That came just five days after he added $136,750. All together, Delaney lent his campaign $2.1 million. His entire campaign raised nearly $3.6 million.

Bartlett, meanwhile, raised a little more than $1.1 million. He kicked in nothing.

Steve Gottlieb, the chair of the Republican Party Central Committee, blamed redistricting for the loss. He also said Delaney had a more “gregarious” personality than Bartlett, who was “reserved” and less likely to connect with younger voters.

“It’s been a very tough race,” Gottlieb said.

Danielle Douglas contributed to this report.