WASHINGTON  The Federal Bureau of Investigation said Friday that it had improperly obtained the phone records of reporters for The New York Times and The Washington Post in the newspapers’ Indonesia bureaus in 2004.

Robert S. Mueller III, director of the F.B.I., disclosed the episode in a phone call to Bill Keller, the executive editor of The Times, and apologized for it. He also spoke with Leonard Downie Jr., the executive editor of The Washington Post, to apologize.

F.B.I. officials said the incident came to light as part of the continuing review by the Justice Department inspector general’s office into the bureau’s improper collection of telephone records through “emergency” records demands issued to phone providers.

The records were apparently sought as part of a terrorism investigation, but the F.B.I. did not explain what was being investigated or why the reporters’ phone records were considered relevant.