WASHINGTON — The National Security Agency has used its bulk domestic phone records program to search for operatives from the government of Iran and “associated terrorist organizations” — not just Al Qaeda and its allies — according to a document obtained by The New York Times.

The document also shows that a February 2010 order from the Foreign Intelligence Surveillance Court for the program listed AT&T and Sprint as involved in it. A leaked 2013 court order for the program was addressed only to a Verizon subsidiary.

The inclusion of Iran and allied terrorist groups — presumably the Shiite group Hezbollah — and the confirmation of the names of other participating companies add new details to public understanding of the once-secret program. The Bush administration created the program to try to find hidden terrorist cells on domestic soil after the attacks of Sept. 11, 2001, and government officials have justified it by using Al Qaeda as an example.

The disclosure of the new details comes at a time of debates over a proposed agreement to drop sanctions against Iran in exchange for curbs on its nuclear program, and about N.S.A. surveillance and the role of American communications companies.