PITTSBURGH — Federal intervention to curb police abuse did not begin after chants of “I can’t breathe,” viral cellphone videos or the Black Lives Matter movement.

It began 21 years ago here in Pittsburgh, where the police were laden with complaints that black residents were routinely singled out for false arrest and abuse. In a City Hall conference room, Chief Robert McNeilly faced a team of lawyers from the Justice Department — young, smartly dressed and newly empowered to rein in the department.

Sizing up the investigators, Chief McNeilly — dressed, as usual, in uniform — had one thought he could not get out of his mind: “There was nobody with any police experience.”

Still, the negotiators groped their way to the first federal “consent decree,” an 83-paragraph court-enforced agreement in 1997 that turned Pittsburgh into a widely emulated model department — for a time, at least.

Since then, there have been consent decrees in 19 other cities, from little Steubenville, Ohio, and Ferguson, Mo., to Los Angeles, Seattle and, as of Friday, Baltimore. Though widely regarded as a net positive, consent decrees, based on a 1994 statute that gave the federal attorney general the authority to combat systemic constitutional violations, have had varying degrees of success and have fallen in and out of favor, buffeted by political winds.

They were pioneered by President Bill Clinton’s Justice Department, largely rejected by President George W. Bush and vigorously revived by the Obama administration. Now, under President Trump, their future is in doubt. Attorney General Jeff Sessions has ordered a review of all federal interventions in law enforcement agencies and tried to delay Baltimore’s new decree.

To revisit the very first police consent decree is to examine a microcosm of the agreements’ potential, and their limitations. Many of the issues, including poor training, racial bias, union opposition and the high cost to carry out the decree, could have been plucked from last week’s headlines. Under its decree, Pittsburgh curtailed strip searches, began documenting traffic stops, gave officers “cultural diversity” training and tracked civilian complaints.

But from the outset, the police union balked, warning of “more drive-by shootings, more drugs” and a spike in crime. Four years after the consent decree ended in 2002, a new mayor, elected with union backing, took office and promptly dismissed Chief McNeilly. (The former chief says he retired voluntarily.) Over time, various aspects of the consent decree fell out of use. One of Chief McNeilly’s successors went to prison during a corruption scandal.

“The only realistic way to look at this is that it did not stick,” said David Harris, a University of Pittsburgh law professor who has written extensively about police reform and who studied the Pittsburgh experience.

Discovering Section 14141

In 1991, long before cellphone videos, there was Rodney King, an unarmed black man whose beating by four Los Angeles police officers was captured in grainy television footage. The episode led to widespread public outrage and congressional hearings on how to address police misconduct. A tiny provision, known as Section 14141, was inserted into a crime bill signed into law by Mr. Clinton in 1994.

The attorney general was authorized to investigate and sue to eliminate any “pattern or practice” of unconstitutional conduct by law enforcement officers. In the Justice Department, civil rights lawyers wrestled with how, and where, to exercise their new authority.

In Pittsburgh, lawyers had been collecting civilian complaints and learned that over 20 years, only one police officer had been disciplined — one who had an altercation with a black man who happened to be the deputy city solicitor.

In 1995, Pittsburgh had its own Rodney King — Jonny Gammage, a black businessman and cousin of a lineman for the Pittsburgh Steelers, who died of asphyxiation during a struggle with white police officers in the suburbs. Though his death did not involve the Pittsburgh police, it galvanized blacks and whites here to work together, said Tim Stevens, the president of the local chapter of the N.A.A.C.P. at the time.

In March 1996, Witold Walczak, a lawyer for the American Civil Liberties Union, learned about Section 14141 while preparing a class-action suit against the Pittsburgh police. He called the Justice Department and offered up his documents, which led to the federal investigation. The city was offered the chance to avoid a federal lawsuit if it agreed to make certain changes — a consent decree.

Though Section 14141 was envisioned as a way to force change, Chief McNeilly, who was new to the job and had been brought on for that very purpose, did not resist.

“When the D.O.J. came in, I pulled out my list and said, ‘These are the things I would do — ethics training, diversity training, communications training for every officer,’” Chief McNeilly said. Also on his list: computers, which the Justice Department ultimately required the city to buy.

“Pittsburgh could very well have been stuck in the ’60s with no computers if it hadn’t had a consent decree,” he said.

The Justice Department had a list of demands — for instance, that every passenger’s race and sex be recorded during traffic stops. Chief McNeilly protested, questioning the practicality and legality of such a requirement. In the end, only the driver’s information was tracked. The Justice Department also required an “early warning system,” opposed by the union, that would flag officers prone to using force.

“Bob McNeilly was like a test pilot in the Mercury flight program,” said Chuck Wexler, the president of the Police Executive Research Forum, a group of law enforcement professionals. “No one knew what an ‘early warning system’ was, how to build it or what to measure.”

Will ‘Ripple Effects’ Fade?

By 2002, when the Pittsburgh decree expired, the department was considered a model of progressive policing.

By then, Mr. Bush was in the White House, having campaigned on a promise not to meddle with the local police. His attorney general, John Ashcroft, told law enforcement executives that “he did not want the federal government managing local police departments.” Years later, Mr. Trump and Mr. Sessions would strike the same chords.

“These lawsuits undermine the respect for police officers,” Mr. Sessions said at his confirmation hearing.

Mr. Bush preferred voluntary arrangements, known as memorandums of agreement. Cleveland, Miami and New Orleans were all investigated by the Bush-era Justice Department, but none were required to enter into consent decrees. All three were reinvestigated by the Obama administration.

President Barack Obama’s first civil rights division chief, Thomas Perez, came in determined to build on the work of the Clinton administration and consent decrees like that in Los Angeles, which had been hailed as a success in a Harvard study.

But Mr. Perez’s hard-charging style drew the ire of union leaders, including James O. Pasco Jr., the national president of the Fraternal Order of Police. In an interview, Mr. Pasco accused Mr. Perez of waging “a virtual jihad against rank-and-file police officers.”

Christy Lopez, a former Justice Department lawyer who worked on police abuse investigations during the Clinton and Obama administrations, said of Mr. Perez: “He represented a shift, and it was very hard for police officers. He was telling them things that no one really had the nerve to tell them before.”

Mr. Perez’s successor, Vanita Gupta, sought to mend fences, but by then, many union leaders say, the relationship had been poisoned.

The Fraternal Order of Police, which was founded in 1915 by two Pittsburgh police officers and now has a membership of well over 300,000 nationwide, has backed presidential candidates of both major political parties over the years but declined to choose between Mr. Obama and his Republican challenger, Mitt Romney, in 2012.

In 2016, the organization backed Mr. Trump.

Obama-era investigative reports were filled with vivid anecdotes and statistics: a 75-year-old homeless man shot with a stun gun for refusing to leave a bus stop; a gang-rape victim who was told that it was “probably just a drunken night and a mistake”; a city where blacks were more than twice as likely as whites to be accused of “milling” or “loitering.”

The consent decrees grew longer and more detailed, and included metrics and public reports. Instead of simply reviewing documents, Justice Department investigators included the views of officers, union leaders and community advocates in an attempt to make changes last.

“In the end, a city completes a consent decree, then the judge goes away, the monitor goes away,” said Samuel Walker, an expert on police accountability. “All cities are on their own, and then it’s dependent on the local community and local politics.”

In 2010, Jordan Miles, 18, an African-American honor student here, was badly beaten by police officers. Suddenly, Pittsburgh was thrown back into its past. Local news media outlets later reported that between 2010 and 2015, the city had used $4.9 million in tax money to settle more than 28 civil rights-related lawsuits against the police.

Despite the backsliding, Mr. Stevens, the civil rights leader, said the consent decree had had lasting “ripple effects” in Pittsburgh. The city’s recently retired police chief, who left after just two years, pushed hard to improve relations with black residents, and the new chief is also talking about police reform.

But Mr. Stevens is worried that what he is hearing from Washington will cause the ripples to subside.

So are officials in Chicago and Baltimore, who, in a sign of how some cities have come to embrace federal intervention, have objected to a retreat from court-ordered police overhauls. The Baltimore police commissioner, Kevin Davis, called the Justice Department’s effort to delay the agreement “a punch in the gut.”

Chief McNeilly and his wife, a former police commander, now consult with departments seeking to improve and see the federal government as a powerful ally.

“To suggest that there aren’t police departments out there that need massive help is naïve,” he said. “You’ve got some of the smartest, best, most experienced attorneys in D.C., and it’s all going to be for naught.”

Correction: April 9, 2017

An earlier version of this article incorrectly identified Christy Lopez. She is no longer a lawyer with the Justice Department.