After four years of secrecy, the Pentagon released the names of hundreds of detainees held at a US military prison on Friday because of a victory by The Associated Press in a Freedom of Information Act lawsuit. The administration of US President George W. Bush had hidden the identities, home countries and other information about the men, who were accused of taking up arms against the United States. But a federal judge rejected administration arguments that releasing the identities would violate the detainees' privacy and could endanger them and their families. The names were scattered throughout more than 5,000 pages of transcripts of hearings in which detainees defended themselves against allegations that they were "enemy combatants." That classification, Bush administration lawyers say, deprives the detainees of Geneva Convention prisoner-of-war protections and allows them to be held indefinitely without charges. Most of the men were captured during the 2001 US-led war that drove the Taliban from power in Afghanistan and sent Osama bin Laden deeper into hiding.