Barry F. Kowalski, a Justice Department lawyer who became one of the country’s premier civil rights prosecutors, winning his most high-profile convictions against two white Los Angeles police officers charged in the 1991 beating of black motorist Rodney King, died June 30 at his home in Arlington, Va. He was 74.

The cause was complications from a stroke, said his daughter Kelly Kowalski.

From the beginning of his legal career, Mr. Kowalski cut an unusual figure at the Justice Department, where he took on Ku Klux Klansmen and became known as the “lion” of the civil rights division.

The son of a onetime Democratic congressman from Connecticut, Mr. Kowalski enlisted in the Marine Corps during the Vietnam War because he thought it was “unfair that poor guys had to go but rich guys didn’t.” After combat service in Southeast Asia, he embarked on his legal career, joining the Justice Department in 1981.

Outside the courtroom, Mr. Kowalski sported cowboy boots and a Stetson-style hat, rode a horse named Moon and penned cowboy songs. “He truly believes in honor and the code of the West,” a reporter for the Atlanta Journal-Constitution once wrote in a profile.

Mr. Kowalski distinguished himself almost immediately by his handling of a federal investigation into the death of Michael Donald, a 19-year-old African American in Mobile, Ala., who was beaten and hanged from a tree with his throat slit in 1981.

Barry F. Kowalski in 2017. (Patty Moskowitz)

One Klan member, James “Tiger” Knowles, pleaded guilty to a federal civil rights offense and received a life sentence. An Alabama circuit court judge sentenced another Klansman, Henry Hays, to death. Mr. Kowalski’s work in the case was credited with a $7 million civil verdict that the Southern Poverty Law Center helped obtain from the United Klans of America in 1987 — damages that largely broke the hate organization.

He taught a generation of prosecutors to use “the grand jury as a tool to ferret out the truth,” Albert Moskowitz, a former chief of the department’s criminal section, said in an interview. He credited Mr. Kowalski with improving the civil rights division’s success rate “tremendously.”

Mr. Kowalski also obtained civil rights convictions against neo-Nazis in the 1984 murder of Alan Berg, a Jewish radio host in Denver. He unsuccessfully prosecuted Joseph Paul Franklin in the 1980 shooting of National Urban League President Vernon E. Jordan Jr., later a top adviser to President Bill Clinton. Franklin was acquitted but later confessed to the attack and was executed in Missouri for other crimes in 2013.

Mr. Kowalski was best known for his role in the case of King, whose beating, captured on grainy film footage that was broadcast nationally, ignited devastating riots in Los Angeles after a California jury with no black members found three officers not guilty of assault. A mistrial was declared for a fourth officer.

The officers, who had engaged in a high-speed chase with King after highway patrol officers sought to pull him over for speeding, said that they believed King to be under the influence of the aggression-inducing drug PCP. Later test results showed that, although he had consumed alcohol, he had not used PCP.

After the verdicts, the Justice Department moved quickly to open a separate civil rights investigation, with Mr. Kowalski, then serving as deputy chief in the civil rights division’s criminal section, at the helm.

“As I was packing and getting ready to go to Los Angeles,” Mr. Kowalski told the Los Angeles Times in 1993, “I remember thinking that it was very much like packing to go to Vietnam. I figured it was going to be about a year. And I figured I might be coming home either on my shield or carrying my shield.”

Mr. Kowalski became co-lead prosecutor along with a younger colleague, Steven Clymer. One of Mr. Kowalski’s “seminal contributions,” Clymer said, was the gentle and effective way in which he prepared King, who had not testified at the state trial, to take the stand in the federal proceedings. His testimony provided an emotional peak in the trial — showing the jury, Clymer said, that “Rodney King was a very sympathetic human being” who “didn’t deserve what happened to him.”

“I was just trying to stay alive, sir, trying to stay alive,” King said under questioning by Mr. Kowal­ski. “They never gave me a chance to stay still.”

In his closing argument, Mr. Kowalski implored the jury: “Let’s call it like it was. They were bullies with badges.” Two defendants, Stacey C. Koon and Laurence M. Powell, were convicted. Two others, Theodore J. Briseno and Timothy E. Wind, were found not guilty. There was no further rioting in Los Angeles.

(King died in 2012 at 47 after drowning at his home swimming pool; medical examiners ruled that drugs in his system, including cocaine, marijuana and PCP, were contributing factors.)

After the trial, according to the Times, a reporter inquired of Mr. Kowalski if there had been “moments where you stepped back and reflected on and felt some of the pressure of an entire country looking to this case for fairness in a symbolic sense.”

Mr. Kowalski replied simply, “Of course, there were.”

Barry Frank Kowalski was born in Hartford, Conn., on Aug. 26, 1944, and grew up mainly in Alexandria, Va. His mother was an artist, and his father, Frank, served in the Army, attaining the rank of colonel before he was elected to the first of two terms in the U.S. House of Representatives in 1958.

After graduating in 1966 from Brown University and working in the office of Vice President Hubert H. Humphrey, Mr. Kowalski enlisted in the Marine Corps. He considered fleeing to Canada when he faced the prospect of combat duty but said he was not “courageous enough” to do it.

“So I ended up being an infantry platoon officer,” he said years later in an oral history with Brown University, “shot at almost every day of my life for six months.”

Mr. Kowalski led an organization of veterans who supported the antiwar candidate Sen. George S. McGovern, the South Dakota Democrat who lost in a landslide to President Richard M. Nixon in 1972. The next year, Mr. Kowalski received a law degree from Catholic University.

After a brief stint in private practice, he joined the office of the corporation counsel in Washington and taught at the old Antioch School of Law in Washington before joining the Justice Department. He retired in 2014, having overseen matters including a reinvestigation of the 1968 assassination of civil rights leader the Rev. Martin Luther King Jr. A 2000 report found “nothing to disturb the 1969 judicial determination that James Earl Ray murdered Dr. King.”

Mr. Kowalski’s first marriage, to Lynn Gardner Heffron, ended in divorce. Survivors include his wife of 24 years, Katie Zimmerman Kowalski of Arlington; a daughter from his first marriage, Kelly Kowalski of Santa Cruz, Calif.; two daughters from his second marriage, Bailey Kowalski and Hallie Kowalski, both of Boulder, Colo.; a sister; and two granddaughters.

“It’s God’s work,” Mr. Kowalski told the Atlanta newspaper of his career at the Justice Department. “God made somebody a certain color, a certain way. God didn’t intend for that person to suffer because of that. When someone gets hurt because of that, that is one of the most heinous crimes. It’s despicable.”

An earlier version of this obituary incorrectly referred to the 1969 assassination of Martin Luther King Jr. The civil rights leader was killed in 1968.