WASHINGTON — The Drug Enforcement Administration has formally acknowledged that it maintained a sweeping database of phone calls made from the United States to multiple foreign countries.

The program has since been discontinued, the Justice Department said Friday.

The revelation was made in a court filing in the case of a man accused of conspiring to export goods and technology illegally to Iran.

A DEA official wrote in a three-page document filed Thursday that the program relied on administrative subpoenas to collect records of calls originating in the United States to foreign countries, including Iran, that were “determined to have a demonstrated nexus to international drug trafficking and related criminal activities.”

The statement said the records kept track of the date, time and duration of the phone call between the initiating telephone number and the receiving telephone number.

The database could then be used to query a specific telephone number if law enforcement officials “had a reasonable articulable suspicion that the telephone number was related to an ongoing federal criminal investigation,” according to a declaration by Robert Patterson, a DEA assistant special agent in charge.

The statement said the database did not include communications content, subscriber information or personal identifying information.

Patrick Rodenbush, a Justice Department spokesman, said Friday that the program was discontinued in September 2013 and that all information held in the database has since been deleted.

In a letter dated in March 2014, Sen. Patrick Leahy, then chairman of the Senate Judiciary Committee, urged Attorney General Eric Holder to ensure that the DEA program was discontinued and also made public. The program was collecting an “enormous number of records” as part of routine drug investigations, through methods that were intrusive and discriminate, according to the letter made public Friday.

The program is separate from a National Security Agency phone records program exposed in 2013 by former NSA systems analyst Edward Snowden.

And although the DEA database appears to be more limited in scope, Leahy and others said its existence shows the troubling extent to which electronic government surveillance has not been limited solely to counterterrorism investigations.