WASHINGTON — The government may not rely on a disputed law enacted last year to hold people in indefinite military detention on suspicion that they “substantially supported” Al Qaeda or its allies — at least if they had no connection to the Sept. 11 terrorist attacks, a federal judge said on Wednesday.

In an eight-page memorandum opinion and order, Judge Katherine B. Forrest of the Southern District of New York clarified a preliminary injunction she issued on May 16 in a lawsuit brought by journalists and activists who challenged the statute — a provision of the National Defense Authorization Act of 2011 — and expressed fear that they could be detained.

The Obama administration had asked Judge Forrest to reconsider her ruling, saying that the plaintiffs lacked legal standing to challenge the law and that it was “extraordinary” for her to have restrained future military operations that might be ordered by the commander in chief during wartime.

As part of that request, the government said in a footnote that it was interpreting her injunction narrowly as applying only to the handful of people specifically named as plaintiffs in the lawsuit, including Chris Hedges, a journalist who interacts with terrorists as part of his reporting work, and several prominent supporters of WikiLeaks.