By Barbara Starr

James Clapper, the director of national intelligence, has apologized to a Senate committee for giving members a "clearly erroneous" answer about U.S. surveillance programs this year.

In a June 21 letter to Intelligence Committee Chairman Dianne Feinstein that is just coming to light now, Clapper said he wanted to "set the record straight."

The end of a March hearing touched on remarks last summer by National Security Agency Director Gen. Keith Alexander, who said a "story that we have millions or hundreds of millions of dossiers on people is completely false."

That comment was the basis for a question by Sen. Ron Wyden, who asked Clapper whether the National Security Agency (NSA) collected "any type of data at all on millions or hundreds of millions of Americans?"

Clapper answered, "No, sir."

Wyden: "It does not?"

Clapper: "Not wittingly. There are cases where they could inadvertently perhaps collect, but not wittingly."

The exchange preceded by three months the blockbuster disclosure by former NSA contractor Edward Snowden that the agency, indeed, had extensive, classified electronic surveillance of telephone and e-mail records.

Clapper said he confused NSA programs when answering Wyden, saying he only realized later that the Oregon Democrat was referring to the telephone surveillance program aimed at overseas communication to and from the United States.

"I have thought long and hard to re-create what went through my mind at the time," he said, adding that "my response was clearly erroneous - for which I apologize," Clapper said.

Clapper says he was faced with trying to answer a question about a program that at the time was still classified. He also thought, he said, that Wyden was talking about the collection of phone call content rather than metadata.

Clapper said he wrote the letter to the committee "because of the charged rhetoric and heated controversy" after he responded to Wyden's question.

Clapper said he sought to privately correct his answer to the committee but also sought to write a public letter.

"I can now openly correct it because the existence of the metadata collection program has been declassified," he said.

Tom Caiazza, a spokesman for Wyden, said Clapper's office acknowledged soon after the March hearing that his statement was inaccurate "but refused to correct the public record when given the opportunity."

Caiazza said Wyden's staff told Clapper's office "that this was a serious concern" and the lawmaker "continued to raise concerns about the government's reliance on secret law in the weeks following the hearing."

"Senator Wyden is deeply troubled by a number of misleading statements senior officials have made about domestic surveillance in the past several years. He will continue pushing for an open and honest debate about programs and laws that touch on the personal lives of ordinary Americans," Caiazza said.