John T. Curtin, a federal judge whose rulings forced Buffalo to desegregate its schools and the Occidental Chemical Corporation to clean the chemical wastes at the toxic Love Canal landfill, died on April 14 in Orchard Park, N.Y. He was 95.

His death, at a nursing home, was confirmed by his daughter Patricia Curtin.

Buffalo’s schools were largely segregated in 1976 when Judge Curtin made his first major decision in a lawsuit filed by a councilman, the N.A.A.C.P. and a local civil rights group against the city’s superintendent of schools, its Common Council, the New York State Board of Regents and the state commissioner of education, among others.

Twenty-nine of the city’s 98 public schools were 90 percent white. Twenty others were more than 90 percent nonwhite. Only 3,000 of Buffalo’s schoolchildren, out of about 50,000, were being bused to achieve racial integration.

In his first of a series of rulings, Judge Curtin wrote that the defendants had violated the 14th Amendment right to equal protection under the laws “by intentionally causing and maintaining a segregated school system.”

He excoriated the Common Council for cutting off money needed to help the Board of Education carry out its own modest integration plans, and he accused the Board of Regents of always trying to find the “route of least possible integrative consequence, hoping to stall until another day any meaningful integration.”

The Regents and the commissioner of education, he wrote, had failed to use their resources to enforce integration “and in so doing encouraged the city defendants to continue their own segregative actions.”

Judge Curtin’s court order came more than two decades after the Supreme Court’s landmark 1954 decision in Brown v. Board of Education, which declared an end to the “separate but equal” system of racial segregation in public schools.

In Boston, it took until 1974 for a federal judge, W. Arthur Garrity Jr., to order the city’s schools to be desegregated. The busing of thousands of black and white Boston students to equalize the racial mixes in the schools led to racial turmoil and death threats against Judge Garrity.

“Outside the South, federal courts and the federal government wrestled with what constituted a de jure segregation violation, so it took longer to litigate some of these cases,” Erica Frankenberg, a professor of education at Pennsylvania State University, said.

Judge Curtin’s rulings in the case led to the closing of heavily segregated schools in Buffalo; the opening of numerous magnet schools to encourage black and white students to be voluntarily bused from their home districts; and the hiring of more minority teachers.

By 1985, only 15 percent of the 30,000 students being bused had been ordered to take part in the program by Judge Curtin. Magnet schools were considered the jewel of the schools’ integration efforts.

“I’m distressed by people who make statements nationally that integration doesn’t work,” Judge Curtin said nearly a decade after his first court order. “It does work. It’s plain wrong to say it won’t. It’s worked in Buffalo.”

He received hate mail and threats from people who objected to the changes his rulings wrought on their schools and neighborhoods.

“To many people in Buffalo, Judge Curtin had become an omnipotent authority figure, a man with the power to bless or befoul the community at his choosing,” Mark Goldman wrote in “City on the Edge: Buffalo, New York” (2007).

Judge Curtin lifted the desegregation order in 1995. But in 2014, using data from 2012, The Buffalo News reported that 70 percent of the city’s schools were once again segregated, defined as having student enrollments that were at least 80 percent minority or 80 percent white. That was about the same level of segregation as at the time of the judge’s first court order.

Still, Judge Curtin maintained that the case had been worthwhile, because families had ultimately accepted his court order to desegregate. “The school case was difficult but important,” he told The Buffalo News last year.

His oversight of the Buffalo desegregation overlapped with a lawsuit over Occidental’s responsibility for cleaning long-disposed chemical wastes at the Love Canal landfill, one of America’s worst environmental disasters.

From 1942 to 1953, 21,800 tons of chemical waste, some of it containing known or suspected carcinogens, were dumped in Love Canal, a neighborhood in Niagara Falls, N.Y., by Hooker Chemicals and Plastics Company, which later became part of Occidental.

The waste was covered over, and houses and a school were built nearby. But chemicals from the landfill eventually seeped into backyards and basements. Residents became ill. Starting in the late 1970s, hundreds of families were evacuated.

In his order, Judge Curtin said it was “beyond dispute” that Occidental’s “disposal practices were at least partially responsible for the release, or threatened release, of the chemicals from the Love Canal landfill.”

Occidental has paid more than $200 million in cleanup costs and medical expenses for the victims.

John Thomas Curtin was born in Buffalo on Aug. 24, 1921. His father, John, was a mill foreman at Bethlehem Steel; his mother, the former Ella Quigley, was a bank secretary.

His education at Canisius College in Buffalo was broken up by his service in the Marines as a fighter pilot in World War II, when he flew 35 combat missions in the South Pacific. After returning, he graduated in 1946, earned his law degree from Buffalo Law School and served stateside in the Marine Corps Reserve during the Korean War.

After working in private practice and then with the Buffalo law department, he was named United States attorney for western New York. Six years later, President Lyndon B. Johnson appointed him a federal judge for New York’s western district at the recommendation of Senator Robert F. Kennedy.

In addition to his daughter Patricia, Judge Curtin is survived by his wife, the former Jane Good; three other daughters, Ann Maxwell, Eileen Bellanca and Mary Ellen Curtin; three sons, John, Mark and William; 10 grandchildren; and two great-grandchildren.

Judge Curtin also presided over a Vietnam War-era case involving five protesters who had broken into Buffalo’s Old Post Office to destroy Selective Service records in 1971. At their trial, they refused to stand when Judge Curtin entered the courtroom, and justified their actions as a legitimate response to the war.

A jury found them guilty of conspiracy to destroy draft records and intent to commit third-degree burglary. But instead of sending them to prison, Judge Curtin gave them suspended one-year sentences and put them on probation.

“Each of you,” he told them, “is free to speak your mind, associate with your friends, attend meetings, travel and continue your efforts in a peaceful manner.”

One of the protesters, Jeremiah Horrigan, called Judge Curtin last year, shortly after he had stepped down from the bench.

Mr. Horrigan, a recently retired newspaper reporter, asked the judge why he had granted him freedom.

“I just followed procedure,” Mr. Horrigan quoted him as saying in a retrospective article he wrote about the case. “I took into account your background, the fact that you had no criminal record, your family situation.”

Mr. Horrigan went on to marry and have two children and four grandchildren. “I tried to tell him how much I owed him the only way I knew how,” he wrote of the judge, “by describing the barest outlines of a life of the luckiest man I know, a life he allowed to happen.”