WASHINGTON  A federal judge ruled Monday that White House visitor logs were public records and ordered the Bush administration to stop withholding them from scrutiny by outside groups.

The ruling, by Judge Royce C. Lamberth of Federal District Court here, was a blow to the administration, which had tried to shield the logs under a claim of executive privilege. The blow could, however, be largely symbolic; the White House seemed likely to appeal the decision, which could hold up the release of any documents until after President Bush leaves office in 13 months.

Judge Lamberth was ruling in a case brought by a left-leaning advocacy group in Washington that had sought to determine how often several conservative religious leaders entered the White House for meetings during the Bush administration. The order could have an impact on other lawsuits seeking visitor logs from the White House, including a suit that seeks a tally of visits by Jack Abramoff, the corrupt Republican lobbyist.

Judge Lamberth held that because the logs were maintained by the Secret Service and not directly by the White House, they could not be shielded from release under the federal Freedom of Information Act.