WASHINGTON -- President Barack Obama said Thursday a "balance" should be struck between national security interests and freedom of the press, in response to a question about the Justice Department's decision to subpoena the phone records of the Associated Press.

"Leaks related to national security can put people at risk, they can put men and women in uniform that I've sent into the battlefield at risk," Obama said, while declining to comment on the pending case.

"U.S. national security is dependent upon those folks being able to operate with confidence that folks back home have their backs, so they're not just left out there high and dry."

Obama said he made "no apologies" for being concerned about national security but that the free flow of information was important to him as well.

Attorney General Eric Holder said Wednesday that his second-in-command, Deputy Attorney General James Cole, had signed off on the AP subpoenas. Obama said Thursday he had "complete confidence" in Holder.

Obama rebuffed a comparison between his governing style and that of former President Richard Nixon.

"I'll let you guys engage in those comparisons," Obama said. "You can read the history and draw your own conclusions."

Sabrina Siddiqui contributed reporting.

Also on HuffPost:

Loading Slideshow...
  • Attorney General Eric Holder pauses as he testifies on Capitol Hill in Washington, Wednesday, May 15, 2013, before the House Judiciary Committee oversight hearing on the Justice Department. Holder is expected to face aggressive questioning on topics ranging from the Justice Department's gathering of phone records at the Associated Press to the government's handling of intelligence before the Boston Marathon bombings. (AP Photo/Carolyn Kaster)

  • Rep. Darrell Issa (R-Calif.) questions Attorney General Eric Holder on Capitol Hill in Washington, Wednesday, May 15, 2013, during the House Judiciary Committee oversight hearing on the Justice Department. (AP Photo/Carolyn Kaster)

  • Attorney General Eric Holder reacts to aggressive questioning from Rep. Darrell Issa, R-Calif. as he testifies on Capitol Hill in Washington, Wednesday, May 15, 2013, as the House Judiciary Committee focused on oversight of the Justice Department. Lawmakers pressed for answers about the unwarranted targeting of Tea Party and other conservative groups by the Internal Revenue Service and the Justice Department's secret seizure of telephone records at The Associated Press. (AP Photo/J. Scott Applewhite)

  • House Judiciary Committee Chairman Rep. Bob Goodlatte (R-Va.) speaks on Capitol Hill in Washington, Wednesday, May 15, 2013, as Attorney General Eric Holder testified before committee's oversight hearing on the Justice Department. Holder told the committee that a serious national security leak required the secret gathering of telephone records at The Associated Press as he stood by an investigation in which he insisted he had no involvement. (AP Photo/Carolyn Kaster)

  • Attorney General Eric Holder gestures as he testifies on Capitol Hill in Washington, Wednesday, May 15, 2013, before the House Judiciary Committee as it focuses on oversight of the Justice Department. Holder told the committee that a serious national security leak required the secret gathering of telephone records at The Associated Press as he stood by an investigation in which he insisted he had no involvement. (AP Photo/J. Scott Applewhite)

  • Attorney General Eric Holder, the nation's top law enforcement official, prepares to testify on Capitol Hill in Washington, Wednesday, May 15, 2013, before the House Judiciary Committee oversight hearing on the Justice Department. House Judiciary Committee Chairman Rep. Bob Goodlatte,R-Va., wants to know more about the unwarranted targeting of Tea Party and other conservative groups by the Internal Revenue Service and the Justice Department's secret seizure of telephone records at The Associated Press. (AP Photo/J. Scott Applewhite)

  • Attorney General Eric Holder pauses while testifying on Capitol Hill in Washington, Wednesday, May 15, 2013, before the House Judiciary Committee oversight hearing on the Justice Department. Holder told Congress Wednesday that a serious national security leak required the secret gathering of telephone records at The Associated Press as he stood by an investigation in which he insisted he had no involvement. (AP Photo/Carolyn Kaster)

  • Attorney General Eric Holder, the nation's top law enforcement official, arrives on Capitol Hill in Washington, Wednesday, May 15, 2013, to testify before the House Judiciary Committee oversight hearing on the Justice Department. House Judiciary Committee Chairman Rep. Bob Goodlatte,R-Va., wants to know more about the unwarranted targeting of Tea Party and other conservative groups by the Internal Revenue Service and the Justice Department's secret seizure of telephone records at The Associated Press. (AP Photo/J. Scott Applewhite)

  • Attorney General Eric Holder gestures as he testifies on Capitol Hill in Washington, Wednesday, May 15, 2013, before the House Judiciary Committee oversight hearing on the Justice Department. Holder is expected to face aggressive questioning on topics ranging from the Justice Department's gathering of phone records at the Associated Press to the government's handling of intelligence before the Boston Marathon bombings. (AP Photo/Carolyn Kaster)

  • Attorney General Eric Holder gestures while testifying on Capitol Hill in Washington, Wednesday, May 15, 2013, before the House Judiciary Committee oversight hearing on the Justice Department. Holder told Congress Wednesday that a serious national security leak required the secret gathering of telephone records at The Associated Press as he stood by an investigation in which he insisted he had no involvement. (AP Photo/Carolyn Kaster)

  • Attorney General Eric Holder, the nation's top law enforcement official, is sworn in on Capitol Hill in Washington, Wednesday, May 15, 2013, prior to testifying before the House Judiciary Committee oversight hearing on the Justice. Department. House Judiciary Committee Chairman Rep. Bob Goodlatte,R-Va., wants to know more about the unwarranted targeting of Tea Party and other conservative groups by the Internal Revenue Service and the Justice Department's secret seizure of telephone records at The Associated Press. (AP Photo/J. Scott Applewhite)

  • Attorney General Eric Holder testifies on Capitol Hill in Washington, Wednesday, May 15, 2013, before the House Judiciary Committee oversight hearing on the Justice Department. Holder is expected to face aggressive questioning on topics ranging from the Justice Department's gathering of phone records at the Associated Press to the government's handling of intelligence before the Boston Marathon bombings. (AP Photo/Carolyn Kaster)