WASHINGTON — A federal judge has rejected a legal challenge to rules permitting F.B.I. agents, when working on domestic criminal cases, to search emails written by Americans that the government has intercepted without a warrant in the name of gathering foreign intelligence.

In an 80-page opinion that was issued in November and remained classified until being made public on Tuesday, Judge Thomas F. Hogan, the chief judge of the Foreign Intelligence Surveillance Court, ruled that what critics call “backdoor searches” of messages by the F.B.I. comply with both the Constitution and the FISA Amendments Act. That 2008 statute legalized a form of the government’s once-secret warrantless surveillance program.

Under the program, which the Bush administration started in 2001 to hunt for terrorists, the government may collect, on domestic soil and without a warrant, international emails and phone calls of noncitizens abroad, even when they communicate with Americans.

Judge Hogan’s ruling is notable because some lawmakers want to require government agencies to get a warrant before searching the raw repository of emails for an American’s name or email address. Bipartisan majorities in the House have twice passed such a proposal in the last two years, and it is expected to be a central feature of a fight over legislation to renew the FISA Amendments Act, which is set to expire at the end of 2017.