Maryland Gov. Martin O’Malley (D) has effected a serious career change — from politician to judge — for a one-term congressman swept out of office during the 2010 Republican takeover of the House of Representatives.

Former Rep. Frank M. Kratovil Jr. (D) will fill a vacancy on the District Court for Queen Anne’s County, O’Malley’s office announced Wednesday, fulfilling a move telegraphed this fall when Kratovil applied for the judgeship.

The appointment cements the outcome of Maryland’s congressional redistricting process on the eastern side of the state.

After speculation swirled for months that O’Malley and the state’s Democratic leadership might try to redraw congressional boundaries to help Kratovil, the process instead all but extinguished Kratovil’s political fortunes when state Democrats turned their attention elsewhere.

Rather than targeting Kratovil’s successor, Rep. Andy Harris (R), O’Malley’s map instead harnessed the state’s surging minority — and mostly Democratic — population in Washington’s Maryland suburbs to give the party a fighting chance of unseating Western Maryland’s 10-term Republican Rep. Roscoe G. Bartlett.

The controversial map was upheld last week by a panel of three federal judges, all but clearing the way for a competitive election for Bartlett’s seat, while giving job security to Harris — potentially for the next decade or more.

Kratovil, a Lanham native whose term in Congress was flanked by jobs as a state prosecutor, told The Washington Post in October that he applied for the judgeship because he was considering how he could best continue to serve the public. He said he was also mulling what job would best allow him to support his wife and five children.

Maryland District Court judges draw an annual salary of about $127,000.

After his 2010 reelection defeat, Kratovil had taken a job as an assistant state’s attorney in Prince George’s Count, a post he had previously filled from 1994 to 1997.

He eventually served as Queen Anne’s state’s attorney for five years before his election to Congress in 2008.

In a statement, O’Malley said he was honored to appoint Kratovil, saying “his strong work ethic, dedication to justice, and years of experience will make him an excellent judge.”