WASHINGTON — The American Civil Liberties Union on Tuesday asked a federal appeals court to partly shut down the National Security Agency program that collects Americans’ phone records in bulk, which resumed last month after a lapse of several weeks. The move sets up a potential conflict between the regular court system and the nation’s secret spy court over whether the program is legal.

In May, the United States Court of Appeals for the Second Circuit ruled that the program was illegal. It said that the law the government says authorizes the program, Section 215 of the U.S.A. Patriot Act, could not be legitimately interpreted as permitting the systematic collection of Americans’ domestic phone records. But the court refrained from issuing an injunction because the law was about to expire.

In early June, Congress passed a law, the U.S.A. Freedom Act, extending Section 215 but saying the government could not use that provision for bulk collection after a 180-day transition period. The bill did not say whether Section 215 could be used for bulk collection before that period expires Nov. 29, so the question of whether the program would be legal until then remained ambiguous.

In late June, a judge on the secret Foreign Intelligence Surveillance Court disagreed with the Second Circuit that the program was illegal and authorized the N.S.A. to resume collecting bulk phone records for the duration of the 180-day period. Now the A.C.L.U. is asking the Second Circuit to block the program with the injunction it had previously refrained from issuing.