Former Maryland Gov. Martin O'Malley conceded in a recent court deposition his party deliberately set out to rewrite the state's congressional map to oust long-serving Republican lawmaker Roscoe Bartlett to hand the state an all-Democratic congressional delegation at the time.

"That was my hope," the Democrat said, according to Baltimore Sun report. "It was also my intent to create ... a district where the people would be more likely to elect a Democrat than a Republican."

The Democrats added several heavily liberal regions to what had been Bartlett's district following the 2010 Census. It was widely suspected at the time this was done to ensure the incumbent's defeat. The Maryland congressional districts had to be heavily redrawn because slow population growth had cost the state a House seat.

Bartlett, who had represented his district for two decades, lost his 2012 re-election bid to now-incumbent Rep. John Delaney. The same year, in a separate House race, Republican Andy Harris ousted Democrat Frank Kratovil to prevent an all-Democratic Maryland caucus.

O'Malley was testifing in a lawsuit filed against the state by Republican residents. They argue the redistricting violated their First Amendment rights by creating conditions that made it impossible for them to elect a member of the GOP.

In addition to O'Malley, Democrats including House Minority Leader Steny Hoyer, State Senate President Thomas V. Mike Miller and Maryland Speaker Michael Busch have been deposed as part of the lawsuit. NCEC Services, the outside consultant group hired by the Democrats to do the redrawing, was also deposed.

"The purpose of what we were doing was, No. 1, incumbent protection. And No. 2, trying to see if there was a way that there was another Democrat district in the state," NCEC analyst Eric Hawkins said in his deposition.

The effort was difficult for the Democrats because of the state's unusual shape and that the largest liberal populations were concentrated in two areas, the Washington D.C. suburbs and the Baltimore metro area. Several incumbents also objected to anything that would have made their own districts less secure.

"Congresswoman [Donna] Edwards was not willing to discuss anything about the map and felt that whatever we do in any other district is fine by her, but she did not want a single precinct of her district moved anywhere," O'Malley said.

Some of the Democrats continue to maintain that politics did not play a role in the redistricting.

"Since I don't run for Congress, I'm not a member of Congress, I want lines that are drawn that are fair to everybody. And like I said before, I'm bipartisan. I work for Republicans and Democrats," Miller said in his deposition.