WASHINGTON – The U.S. government is collecting electronic records on the travel habits of millions of Americans who fly, drive or take cruises abroad, retaining data on the persons with whom they travel or plan to stay, the personal items they carry during their journeys, and even the books that travelers have carried, according to documents obtained by a group of civil liberties advocates and statements by government officials.

The personal travel records are meant to be stored for as long as 15 years, as part of the Department of Homeland Security’s effort to assess the security threat posed by all travelers entering the country. Officials say the records, which are analyzed by the department’s Automated Targeting System, help border officials distinguish potential terrorists from innocent people entering the country.

But new details about the information being retained suggest that the government is monitoring the personal habits of travelers more closely than it has previously acknowledged. The details were learned when a group of activists requested copies of official records on their own travel. Those records included a description of a book on marijuana that one of them carried and small flashlights bearing the symbol of a marijuana leaf.

The Automated Targeting System has been used to screen passengers since the mid-1990s, but the collection of data for it has been greatly expanded and automated since 2002, according to former Homeland Security officials.

Officials Friday defended the retention of highly personal data on travelers not involved in or linked to any violations of the law. But civil liberties advocates have contended that the type of information preserved by the department raises alarms about the government’s ability to intrude into the lives of ordinary people. The millions of travelers whose records are kept by the government are generally unaware of what their records say, and the government has not created an effective mechanism for reviewing the data and correcting any errors, activists said.

The activists contended that the data collection effort, as carried out now, violates the Privacy Act, which bars the gathering of data related to Americans’ exercise of their First Amendment rights, such as their choice of reading material or persons with whom to associate. They also expressed concern that such personal data one day could be used to impede their right to travel.

“The federal government is trying to build a surveillance society,” said John Gilmore, a civil liberties activist in San Francisco whose records were requested by the Identity Project, an ad-hoc group of privacy advocates in California and Alaska. The government, he said, “may be doing it with the best or worst of intentions. . . . But the job of building a surveillance database and populating it with information about us is happening largely without our awareness and without our consent.”

Gilmore’s file, which he provided to the Washington Post, included a note from a Customs and Border Patrol officer that he carried the marijuana-related book “Drugs and Your Rights.” “My first reaction was I kind of expected it,” Gilmore said. “My second reaction was, that’s illegal.”

Homeland Security officials said this week that the government is not interested in passengers’ reading habits, that the program is transparent, and that it affords redress for travelers who are inappropriately stymied. “I flatly reject the premise that the department is interested in what travelers are reading,” department spokesman Russ Knocke said. “We are completely uninterested in the latest Tom Clancy novel that the traveler may be reading.”

But, Knocke said, “if there is some indication based upon the behavior or an item in the traveler’s possession that leads the inspection officer to conclude there could be a possible violation of the law, it is the front-line officer’s duty to further scrutinize the traveler.” Once that happens, Knocke said, “it is not uncommon for the officer to document interactions with a traveler that merited additional scrutiny.”

He said he is not familiar with the file that mentions Gilmore’s book about drug rights, but that generally “front-line officers have a duty to enforce all laws within our authority, for example, the counternarcotics mission.” Officers making a decision to admit someone at a port of entry have a duty to apply extra scrutiny if there is some indication of a violation of the law, he said.

The retention of information about Gilmore’s book was first disclosed this week in Wired News. Details of how the Automated Targeting System works were first disclosed in a Federal Register notice in November. Although the screening has been in effect for more than a decade, data for the system in recent years have been collected by the government from more border points, and also provided by airlines – under U.S. government mandates – through direct electronic links that did not previously exist.

In addition to evacuating 10 neighboring homes, deputies restricted pedestrian and vehicle traffic in the area while the sheriff's office bomb squad "safely disposed" of the explosives, officials said.