President Obama appointed a new top White House lawyer Thursday, adding to the roster of women in high-profile positions in his administration.

Kathryn Ruemmler, 40, replaces Bob Bauer, a longtime Obama adviser who will return to private practice but will continue to advise Obama as a personal lawyer and offer legal counsel to Obama’s reelection campaign and the Democratic National Committee.

Ruemmler, who had served as Bauer’s deputy, takes over the job as the White House grapples with questions over the future of detainees at the military prison at Guantanamo Bay, oversight investigations by the new Republican majority in the House and legal challenges to the health-care overhaul.

She joined the administration in 2009 as a deputy attorney general and was named Bauer’s deputy in early 2010. In a statement Thursday, Obama called Ruemmler an “outstanding lawyer with impeccable judgment.”

Ruemmler served in the Clinton White House as an associate counsel and at the Justice Department, where she worked on white-collar crime as well as criminal cases ranging from drug and robbery offenses to murder.

Named one of the “40 lawyers under 40” by Washingtonian Magazine in 2006, Ruemmler was one of the lead prosecutors and the youngest member of the team that successfully prosecuted top officials at Enron.

“It was remarkable to me to see a prosecutor who had the fight and zeal she had but had the conscience of a defense attorney,” said Mary Flood, a former Houston Chronicle reporter who covered the Enron trial and is now a close friend of Ruemmler. “She cared about justice and not just about winning. She was concerned about sentencing and having it be appropriate.”

One day, Ruemmler famously showed up in court wearing a conservative gray suit paired with four-inch bright pink stiletto heels.

That, Flood said, was “an athletic feat. . . . She chose to not wear the stewardess outfit but to be herself, and it’s part of what is cool about her, quite frankly.”

Obama recently has named several women to top White House posts, including Brooke Anderson as national security chief of staff, and Alyssa Mastromonaco and Nancy Ann DeParle as deputy chiefs of staff.

Bauer’s is the latest in a series of departures of top administration aides as Obama’s reelection campaign gears up for 2012. Bauer has had the job since late 2009, when he replaced Gregory Craig, who had a rocky tenure marked by clashes with then-chief of staff Rahm Emanuel.

“Bob is a good friend and has served as a trusted adviser for many years,” Obama said in a statement. “Bob was a critical member of the White House team. He has exceptional judgment, wisdom, and intellect, and he will continue to be one of my close advisers.”

As Bauer’s deputy, Ruemmler has managed the White House’s response to the congressional investigations led by Rep. Darrell Issa (R-Calif.), chairman of the House Oversight and Government Reform Committee.

Former Justice official Ken Wainstein, who hired Ruemmler as a federal prosecutor, said the Georgetown law school graduate brings a breadth of experience, including private practice and basic criminal law.

“She has seen law enforcement from the ground level, where there are some real down-and-dirty cases and also cutting-edge cases like Enron,” he said. “That’s a well-rounded experience and gives her invaluable insight in helping the president set policy.”

For her work on the Enron case, where she delivered the closing argument in a complex trial that lasted months, Ruemmler received the attorney general’s Award for Exceptional Service.

Jamie Gorelick, who knows Ruemmler from her days in the Clinton administration, said she brings versatility as a trial lawyer who knows the culture and processes of both the Justice Department and the White House.

“This is a relentless job, and having someone with energy and enthusiasm is going to be very helpful,” Gorelick said. “And having one of the most senior positions in the White House filled by a woman is important and it’s terrific.”