The ruling is a blow to the Bush administration, which has fought the release of records showing visits by prominent religious conservatives.
Visitor records are created by the Secret Service, which is subject to the Freedom of Information Act. But the Bush administration has ordered the data turned over to the White House, where they are treated as presidential records outside the scope of the public records law.
But U.S. District Judge Royce C. Lamberth ruled logs from the White House and Vice President Dick Cheney's residence remain Secret Service documents and are subject to public records requests.
In a lawsuit brought by Citizens for Responsibility and Ethics in Washington, a liberal watchdog group, Lamberth ordered the Secret Service to turn over visitor logs regarding nine conservative religious commentators, including James Dobson, Gary Bauer and Jerry Falwell.
"I think it's hugely significant," said Anne L. Weismann, the watchdog group's chief counsel. "The judge saw their arguments for what they were."
White House spokesman Tony Fratto and Justice Department spokesman Charles Miller said lawyers were reviewing the decision and they would have no immediate response. The Bush administration is expected to appeal the ruling.
In a separate case, CREW had sought an order declaring illegal a Bush administration policy under which the Secret Service destroys its copies of the logs once they are turned over to the White House.
In that second case involving White House visits by disgraced lobbyist Jack Abramoff, Lamberth said he did not have the authority to issue such a ruling.
Because the logs were declared Secret Service records, however, they cannot be destroyed without approval from the National Archives.
Lamberth allowed 19 pages of security-related records to be withheld, reports CBS News Justice Department producer Deirdre Hester. CREW's request for limited discovery on whether visitor records are agency records was denied as moot.
The Bush administration had sought to have the case moved to another judge by consolidating it with a similar lawsuit before U.S. District Judge Rosemary Collyer, an appointee of President Bush.
Lamberth, who served in the Justice Department before President Reagan put him on the federal bench, has roiled Democratic and Republican administrations alike with rulings rejecting government secrecy claims.