Jack Clement at the Country Music Hall of Fame in Nashville, Tenn., in April. (Mark Humphrey/AP)

“Cowboy” Jack Clement, who became one of the most influential backstage forces in country and rock music by producing artists ranging from Johnny Cash to U2 and by helping discover performers such as Jerry Lee Lewis and groundbreaking black country star Charley Pride, died Aug. 8 at his home in Nashville. He was 82.

A friend, Dub Cornett, said Mr. Clement died of liver cancer. Mr. Clement was scheduled to be inducted into the Country Music Hall of Fame in October.

In a career spanning more than five decades, Mr. Clement was a producer, engineer, songwriter and singer. He was best remembered for spotting and showcasing talent, and he notably added the catchy mariachi horns to Cash’s “Ring of Fire” in 1963.

While working as a deputy to Sam Phillips at Memphis’s Sun Records in the 1950s, Mr. Clement wrote Lewis’s “It’ll Be Me” and Cash’s hits “Ballad of a Teenage Queen” and “Guess Things Happen That Way.” He also produced important early hits for Charlie Rich and Roy Orbison.

Mr. Clement later embraced the budding outlaw movement in country music, producing albums by Waylon Jennings, the Flatlanders and singer-songwriter Townes Van Zandt. His other eclectic projects ranged from producing records for jazz trumpeter Louis Armstrong and polka accordionist Frankie Yankovic, to producing a horror movie (“Dear Dead Delilah,” in 1972), to running a publishing company that came up with album art.

When U2 sought him out to produce several tracks on the 1988 album “Rattle and Hum,” he had not heard of the Irish rock band. “I said, ‘I’m not sure you can afford me,’ ” Mr. Clement later told the Chicago Sun-Times.

The U2 recording session, which also featured guitarist B.B. King, was held at the old Sun studio and was filmed for a documentary of the same name. By the time the whole project wrapped, Mr. Clement was infatuated with the rock band.

“After they finished the record and the movie, Bono and Adam [Clayton] were in Hollywood,” he told the Chicago Sun-Times. “They decided they would drive from California to New Orleans. They rented a car and came through Nashville.

“We hung out for four days,” he said. “I have video footage of Bono in this room singing ‘Folsom Prison Blues,’ and I’m singing ‘Silver-Haired Daddy of Mine.’ He kept telling me to play him stuff he never heard. So I gave him a good dose of Tommy Dorsey and Spike Jones. The day they left, we led them out to the freeway to New Orleans. We stood there to wave goodbye, and, as they passed by, Bono was mooning us.”

Jack Henderson Clement was born on April 5, 1931, in Memphis, where his father was a choir director and worked in a jewelry store. His family pushed him into dentistry, but he rebelled and, at 17, joined the Marine Corps. He spent a few years stationed near Washington, where he played guitar in bluegrass bands.

He briefly formed a duo with mandolinist Buzz Busby that accented comedy. “We did a lot of Homer and Jethro type things,” he told author Ken Burke for the book “Country Music Changed My Life.” “I wrote a few things like ‘Lady Insane’ — sung to the tune of ‘Lady of Spain.’ ‘Lady insane, how you bore me.’ That kind of stuff.”

Mr. Clement returned to his home town and started a record label that drew the attention of Phillips at Sun for a recording he made of multi-instrumentalist Billy Lee Riley. Phillips hired Mr. Clement in 1956 as a producer and engineer. On his first day at work, he recorded Orbison.

On another occasion, when Phillips was out, Lewis walked in off the streets with his father, who bragged to Mr. Clement that his son was a piano dynamo. As an afterthought, the producer taped the young man playing “Whole Lotta Shakin’ Goin’ On.”

He later told the Nashville Tennessean that they spent the next few weeks getting down all they could on tape. “We’d just go in the studio and cut anything we could think of,” Mr. Clement said. “We cut, like, 13 songs in one day. The thing about him was he was totally uninhibited. He didn’t have any insecurities. He was just nuts. He’ll go in the studio or anywhere, whether it’s an audience of one or more, and give you the whole show. He didn’t hold back nothing.”

At Sun studio, Mr. Clement recorded the famed 1956 “Million Dollar Quartet” recording session featuring Lewis, Cash, Elvis Presley and Carl Perkins.

After three years at Sun, Mr. Clement became an independent producer and later worked at RCA in Nashville. In the 1960s, he produced acts as varied as the pop-country singer Dickey Lee and the country-folk entertainers Tompall & the Glaser Brothers.

When Cash had a dream about putting mariachi horns into “Ring of Fire,” he called Mr. Clement. “I knew he was the only one who’d see how it could work,” Cash wrote in his autobiography. “There wasn’t any point in even discussing it with anybody else.”

Mr. Clement also persuaded producer Chet Atkins to sign Pride at RCA in 1965. The producers decided it was necessary to get Pride’s music played on the radio before releasing his photograph that would show his race.

“The first session, word got around that some idiot was cutting a black country singer. The studio was packed with half the music business in Nashville, waiting to see if I would make a fool of myself,” Mr. Clement told the publication Country Music People.

He recorded “Snakes Crawl at Night” and other songs that helped launch Pride’s Grammy-winning career. Mr. Clement also recorded some of singer Don Williams’s earlier records as well as Jennings’s defining outlaw album “Dreaming My Dreams” in 1975.

Mr. Clement married at least twice, including once to Jennings’s sister-in-law Sharon Johnson. Survivors include his companion, Aleene Jackson, and two children.

Mr. Clement recorded his own music sparingly. Drawing on his early turn as a comic artist, the songs he wrote were often humorous, with names like “Dirty Old Egg-Sucking Dog,” which Cash sang, and “Drinking Carrot Juice.”

“Jack was a musical mastermind, in a sense, but what made him stand out to people was he had this sense of fun and a little bit of mischief in everything he did,” said Michael McCall, a historian at the Country Music Hall of Fame and Museum in Nashville. “He had a whimsical, creative spirit about him, and he inspired that in other people. In an industry that puts a high value on conformity, he was the ultimate non-conformist, and people loved him for it.”

In a lifetime in the music business, Mr. Clement acquired a reputation for keeping cool around hot-headed stars.

“I’m an unlicensed psychiatrist,” he told Burke. “I’ve heard a lot of stories and dealt with a lot of egos, prima donnas. Hell, I’m not afraid of prima donnas; I chew ’em up and spit ’em out for breakfast.”