A panel of three federal judges upheld Maryland’s controversial new congressional map Friday, ruling that critics had failed to prove the state’s Democratic leadership either sought to dilute the voting power of minorities or that the new map would do so.

The ruling all but cleared the way for Maryland Democrats to seek to oust the state’s senior Republican lawmaker, 10-term Rep. Roscoe G. Bartlett, and to perhaps hand the party a seat to help win back control of the House in 2012.

Under the new map, Bartlett’s 6th Congressional District, which was centered in western Maryland, stretches nearly 200 miles, from the West Virginia line to the Capital Beltway, and takes in nearly 350,000 mostly Democratic voters in Frederick and Montgomery counties.

In making the district competitive for a Democrat, Gov. Martin O’Malley (D) and the legislature split majority-minority Montgomery into three mostly white districts. The plaintiffs had contested that change and had argued that the state’s surging minority population required Maryland to have drawn a third majority-black district.

The judges, however, ruled for the state on every count. In so doing, they affirmed a first-in-the-nation effort by Maryland to count prisoners not in the jurisdiction of incarceration but in those of last-known address.

The state’s Democratically controlled General Assembly passed the law this year. It effectively increased the census counts of Baltimore and Prince George’s County by several thousand at the expense of more rural areas containing Maryland’s largest prisons.

Jason Torchinsky, an attorney for members of the ,Fannie Lou Hamer Political Action Committee who were named plaintiffs, and the conservative Legacy Foundation, which funded the suit, called the judges’ ruling disappointing.

In a 38-page opinion, 4th Circuit Court Judge Paul V. Niemeyer wrote that “evidence does not suggest, much less prove, that the political process in general or the redistricting process in particular is so infected with racial considerations that a desire to dilute African-American voting strength was the predominate factor” in designing Maryland’s new map.

Rather, citing an argument made in a hearing Tuesday by Maryland Assistant Attorney General Dan Friedman, Niemeyer pointed out that several black political leaders, including Montgomery and Prince George’s executives Isiah Leggett (D) and Rushern L. Baker III (D), supported the new map. “As counsel for the State suggested at oral argument, accepting the plaintiffs‘ argument . . . would require us to conclude that — the entire African-American leadership in the State of Maryland was hoodwinked. We cannot reach such a conclusion.”

Alexander Williams Jr. and Roger W. Titus, both of the U.S. District Court for Maryland, concurred in the opinion.

Raquel Guillory, a spokeswoman for O’Malley (D) said, in a statement after the ruling that the governor’s map “complied with the letter and the spirit of the law. We were confident that it would stand up to legal challenges.”

Torchinsky, however, said the state should take seriously parts of the judges’ opinion that stressed Maryland should be careful in deciding lines for state lawmakers.

O’Malley hosted a hearing on that map Thursday and must introduce it when the General Assembly reconvenes next month. The map has drawn protests from some African American lawmakers and community leaders in Prince George’s and Baltimore who contend it does not do enough to protect existing majority black districts. The map increases from 10 to 12 to the number of majority-black Senate districts.

Titus, one of the district court judges, wrote separately to lament that there wasn’t a clearer judicial test for partisan gerrymandering and to make clear he was less than pleased with Maryland’s map, saying portions resemble “a Rorschach-like eyesore.”

It “is clear that the plan adopted by the General Assembly of Maryland is, by any reasonable standard, a blatant political gerrymander,” Titus wrote. “I would not have hesitated to strike down the Maryland plan. The question, however, is on the basis of what standard?”

Titus said he found the combination of extreme western Maryland with suburban Montgomery County particularly distasteful. He said he found the new 6th District to be a violation of natural boundaries and communities of interest that would not have been permissible under state standards for drawing General Assembly districts.

“I realize, of course, that during the redistricting process partisan considerations and incumbency protection inevitably play a role, but....

“Those who have an interest in farming, mining, tourism, paper production, and the hunting of bears, are paired with voters who abhor the hunting of bears and do not know what a coal mine or paper mill even looks like.”