WASHINGTON – The Justice Department under Attorney General William Barr launched a vast surveillance program that gathered records of innocent Americans’ international phone calls without first conducting a review of whether it was legal, the department’s inspector general concluded Thursday.

It happened in 1992, the last time Barr served as attorney general.

The secret program, run by the Drug Enforcement Administration, ultimately gathered billions of records of nearly all phone calls from the United States to 116 countries, with little oversight from Congress or the courts, a USA TODAY investigation found. It provided a blueprint for far broader phone-data surveillance the government launched after the terrorist attacks of Sept. 11, 2001.

The Justice Department’s inspector general said both the DEA and the Justice Department “failed to conduct a comprehensive legal analysis” of its authority to gather those records.

The program was the government’s first known effort to gather records on Americans in bulk, sweeping up information related to millions of Americans regardless of whether they were suspected of a crime. Attorney General Eric Holder ordered the DEA to halt the collection in 2013, after leaks by former National Security Agency contractor Edward Snowden sparked an uproar about the government’s data dragnets.

The DEA obtained those records using administrative subpoenas that allow the agency to collect records "relevant or material to" federal drug investigations without seeking authorization from a judge. The Inspector General said the government did not pause to consider whether its powers allowed it to collect records unrelated to a specific investigation, though former officials familiar with the program have acknowledged that they thought it was an aggressive understanding of the law.

The Inspector General’s report identified areas in which the program would be vulnerable to legal challenges, but did not reach a conclusion about whether it was lawful.

DEA spokeswoman Katherine Pfaff said in a statement that the agency was taking steps to improve its use of administrative subpoenas to gather data, and that the agency's policies "continue to be vetted through a rigorous legal review."

The DEA program did not intercept the content of Americans' calls, but the records – which numbers were dialed and when – allowed agents to map suspects' communications and link them to troves of other police and intelligence data. Agents used those records to search for connections between Americans and overseas drug trafficking groups, though the Inspector General said the drug agency also permitted other agencies to use the records in different types of criminal investigations.

At its peak, the program harvested records of nearly all calls from the United States to Mexico, Canada, nearly all of Central and South America and much of the rest of the world.

The program, known within the drug agency as USTO (a play on call going from the United States to other countries), was carried out in part by the department’s Criminal Division, run at the time by Robert Mueller.