President Obama on Friday for the first time publicly defended his administration’s top-secret phone and Internet surveillance programs, insisting that Americans weren’t being directly targeted and that national-security benefits were worth the “modest encroachments on privacy.”

“Nobody is listening to your telephone calls,” Obama said, acknowledging that his National Security Agency was collecting massive amounts of data on Americans. But he insisted that the data included only telephone numbers and durations of conversations — and that there was no monitoring of actual calls. To listen in on conversations, Obama said it would require court approval.

As for the revelation that the NSA and FBI are also accessing the Internet servers of major U.S. providers, Obama said, “This does not apply to U.S. citizens, and this does not apply to people living in the United States.”

Obama was forced to address the simmering controversies at an event in San Jose, Calif., meant to trumpet his healthcare overhaul. Allies and political foes alike have battered the administration with charges of government overreach as details continue to emerge about its surveillance programs.

Obama offered no apologies, at one point brushing off the controversies as “hype.” He said the secret programs, originated in President George W. Bush’s administration, were subject to Congressional oversight

“I think it’s important to understand that you can’t have 100 percent security and then have 100 percent privacy and zero inconvenience,” he said. “We’re going to have to make some choices as a society.”

Like Director of National Intelligence James Clapper, the president lambasted leaks of sensitive government information.

“I don’t welcome leaks. There’s a reason why these programs are classified,” he said.

The Washington Post and The Guardian reported the NSA and FBI since 2007 have secretly accessed central servers for major U.S. Internet companies, obtaining private data that could be used to track an individual’s conversations and whereabouts. In response to the report, many of the Internet companies mentioned said they were not providing the government direct access to their servers.

Microsoft, Yahoo, Google, Facebook, PalTalk, AOL, Skype, YouTube, and Apple gave e-mails, photos and video to the NSA and FBI, the reports said.

During the same time period, Verizon and other telecommunications companies turned over millions of Americans’ phone records to the federal government.

Friday’s hastily arranged press conference showcased  just how far Obama’s views on privacy and national security have evolved since his days in the Senate. Before running for president, Obama worried that such data seizures by the NSA amounted to fishing expeditions and infringed on Americans’ Constitutional rights.

“In the abstract, you can complain about Big Brother,” Obama said on Friday. “But when you actually look at the details, I think we’ve struck the right balance.”

Revelations of the domestic spying arise at a time when the White House is already fending off a trio of controversies, including the IRS’ targeting of political opponents and the Justice Department’s monitoring of journalists. It also could weaken Obama’s stance on the issues privacy and cyber-espionage ahead of his meeting later Friday with Chinese President Xi Jinping.