During his visit to congressional Democrats on Capitol Hill Wednesday, President Obama defended former treasury secretary, Lawrence Summers, who is a potential candidate to succeed Ben Bernanke as chairman of the Federal Reserve.

164627484_image_982w Lawrence Summers (Photo by Jason Alden - WPA Pool via Getty Images)

Obama had a somewhat testy exchange on the subject with Rep. Ed Perlmutter (D-Colo.) in his closed-door meeting with House Democrats. The lawmaker pressed the president for details on his selection of the next chairman of the Fed and mentioned that former Summers is under consideration.

In response, Obama launched into a defense of Summers, saying he had been critical to restoring the American economy and that he "was not even close to making a decision,” according to one lawmaker. Obama also “expressed frustration” with the negative campaign building against Summers, the lawmaker said.

The subject of who should succeed Bernanke as Fed chairman is dividing Democrats, some of whom believe that Summers is the best choice, while others – including more than a dozen Democratic senators -- think Obama should instead select Janet Yellen, a vice chairman of the bank’s Board of Governors, who would be the first woman to hold the post.

House Minority Leader Nancy Pelosi (D-Calif.) said later that Obama discussed Summers, but only when asked about the Fed selection process.

“It wasn’t really about Larry Summers – it was about how important this decision is, the ramifications of who the chairman of the Fed is and is there for a long time to come and recognizing that there are differing views in our caucus on the subject and how we go forward, but understanding that whoever the president chooses will be received with great respect by our caucus,” Pelosi told reporters.

Obama also faced questions about Summers during a more than hour-long session with Senate Democrats. According to one Democrat present, the president appeared to grow frustrated at the questions of the two potential Fed chair nominees. Obama described their ideological differences on economic policy as "paper thin," the senator said, requesting anonymity to describe the president's private discussion.

Afterward Senate majority leader Harry M. Reid (D-Nev.) also defended Summers, calling him "a friend".

"That decision is up to the president," Reid told reporters, suggesting Democrats would back whoever Obama nominates for the slot.

White House press secretary Jay Carney later said Obama was defending Summers as a valued former member of his economic team that helped craft policy to help the nation recover from the Great Recession.

"He's very grateful of Larry's service with him," Carney said. Carney stressed that Obama will not decide on a Fed chief until the fall.

Paul Kane and David Nakamura contributed to this story.