Mr. Ratner at a news conference in 2002, when he was representing detainees at Guantanamo Bay. (Gerald Martineau/The Washington Post)

Michael Ratner, a civil liberties lawyer who mounted legal challenges to U.S. military actions abroad, helped represent WikiLeaks founder Julian Assange and won a landmark U.S. Supreme Court case that defined legal rights for detainees at Guantanamo Bay, died May 11 at a hospital in Manhattan. He was 72.

The cause was complications from cancer, said his wife, Karen Ranucci.

For nearly half a century, Mr. Ratner was associated with the Center for Constitutional Rights, a New York-based nonprofit legal organization founded during the civil rights movement. He served over the years as legal director and president, establishing a reputation among some government officials as a gadfly and among civil libertarians as a paladin of individual rights at a time when they had come under increasing threat.

He grew up in a home that championed the underdog. His mother helped resettle refugees from the Holocaust, and his father, an immigrant businessman committed to affording second chances, brought ex-cons home for dinner. A turning point for Mr. Ratner came in 1968, when he said he was beaten by police during a student protest at Columbia Law School.

“That night was crucial,” he told the New York Times in 2002. “An event like this created the activists of the next generation. I never looked back. I decided I was going to spend my life on the side of justice and nonviolence.”

Among his earliest cases was a civil suit on behalf of prisoners who revolted at the Attica correctional facility in Upstate New York in 1971. Forty-three people, including both inmates and guards, had died in a days-long confrontation that one state prosecutor described as a “turkey shoot.”

Representing a group of inmates and former inmates, Mr. Ratner called on the judiciary to order the investigation and prosecution of authorities who he alleged violated the law in their response to the insurrection. Mr. Ratner lost the case in 1973.

The prospects of victory rarely factored into his decision to pursue a case. What mattered, he said, was the principle involved.

In 1990, he represented 54 congressional Democrats who unsuccessfully sought a court order barring President George H.W. Bush from taking the country to war in Iraq without congressional authorization; Bush later received authorization. Later that decade, Mr. Ratner represented lawmakers who similarly challenged President Bill Clinton’s authority to continue airstrikes in Kosovo amid ethnic cleansing in the Balkans.

Outside the United States, the targets of his legal work included the repressive Chilean dictator Augusto Pinochet and Radovan Karadzic, the Bosnian Serb leader convicted of genocide and war crimes charges by a United Nations tribunal in March. In the Middle East, he advocated on behalf of Palestinian rights.

But Mr. Ratner’s most high-profile role came during the administration of George W. Bush. In public commentaries and in the courts, he assailed what he regarded as the trampling of individual liberties in the name of national security after the terrorist attacks of Sept. 11, 2001.

Mr. Ratner was on a jog in Lower Manhattan when hijacked airplanes hit the twin towers. In the months and years that followed, as a legal advocate for detainees accused of terrorist involvement, he found himself in an initially uncomfortable position.

“The idea that I would actually represent someone who bombed the World Trade Center didn’t sit so well with me,” he told Newsday. “It didn’t seem what I wanted to do.”

But in time, he and other critics of the Bush administration became convinced that the United States had acted unjustly by detaining alleged “enemy combatants” at the naval facility at Guantanamo Bay, Cuba. Mr. Ratner represented a number of those detainees, acting as a leader in what he and other lawyers dubbed the Guantanamo Bay Bar Association.

Challenges to Bush administration policies at Guantanamo culminated in 2008, when the Supreme Court ruled 5 to 4 that detainees had the right to the writ of habeas corpus, the provision by which an imprisoned person may contest the legality of his or her detention and seek release by a court.

Mr. Ratner later represented Assange, the Australian national whose anti-secrecy website, WikiLeaks, posted troves of government documents. Assange, who faces extradition to Sweden for questioning regarding rape accusations, is currently living as a diplomatic refu­gee at Ecuador’s embassy in London.

Mr. Ratner said that in the course of his legal work, he was threatened by some critics who regarded him as a traitor. He insisted that he was in the right and that the law was a necessary check on government abuses of power.

Referring to detentions at Guantanamo, he told The Washington Post, “Can the United States pick up people anywhere in the world, take them to an offshore prison camp and not have any hearings at all and keep them forever and basically wipe out court review of those cases?

“That’s really significant,” he said. “Are we going to be a state that’s ruled by law and by checks and balances and the Constitution and human rights?”

Michael David Ratner was born in Cleveland on June 13, 1943. His brother, Bruce Ratner, is a prominent real estate developer in New York, and his sister, Ellen Ratner, is a Fox News analyst.

Mr. Ratner received a bachelor’s degree in English from Brandeis University in Waltham, Mass., in 1966 and graduated three years later from Columbia Law School. He wrote or co-authored several books, among them “Guantanamo: What the World Should Know,” “The Trial of Donald Rumsfeld: A Prosecution by Book,” “Who Killed Che? How the CIA Got Away With Murder” and “Hell No: Your Right to Dissent in 21st-Century America.”

He was divorced from his first wife, Margaret, who later married the lawyer William Kunstler, a founder of the Center for Constitutional Rights. Besides his siblings, survivors include his wife of 30 years, Karen Ranucci of New York City; and two children from his second marriage, Jake Ratner and Ana Ratner, both of New York City.

While Mr. Ratner may have appeared single-minded in his practice of the legal profession, he once revealed that as a boy, he had set out to become not a lawyer but an archaeologist.

“I love the past,” he once told the Times. “I have taken my kids to every ruin in Rome. We go on digs in Central America. I used to think it wasn’t political, but it turns out to be highly political. After all, what layer of civilization do you save?”