Jack Clement, who has died aged 82, was not only a prolific and successful songwriter and an able musician but had a long track record in country music as a producer. At Sun Records in Memphis, Tennessee, in the 50s, he worked with Johnny Cash and supervised the first recordings by Jerry Lee Lewis, and over the next half-century he produced George Jones, Waylon Jennings and scores of other artists, from Louis Armstrong to the polka king Frankie Yankovic to U2.
Among the hits he wrote were Cash's Ballad of a Teenage Queen and Guess Things Happen That Way, which both reached No 1 in the country charts in 1958. It'll Be Me was only a B-side for Lewis, but a British hit in 1962 for Cliff Richard. Clement was also responsible for what has become a regular entry in lists of jaw-dropping country song titles, Flushed from the Bathroom of Your Heart.
Born in Whitehaven, a suburb of Memphis, Clement was a youthful fan of rockabilly, hillbilly and cowboy music, and began playing the guitar in his teens. In the early 50s, while completing his military service in the marines in Washington DC, he formed a bluegrass band with the fiddler Scotty Stoneman and the mandolinist Buzz Busby, and played on country music shows in Wheeling, West Virginia, and Boston.
Returning home in 1953, he studied at Memphis State University and made his first venture into the music business when he recorded the rockabilly singer Billy Lee Riley and took the tape to Sam Phillips to master it. Phillips liked the recording and offered him a job at Sun, where he worked for three years as a producer and engineer. "One time I told Roy Orbison I didn't think he'd ever make it as a ballad singer. D'you think he'd ever let me forget that?"

In 1959, following what he later described as a "misunderstanding" with Phillips, Clement moved to Nashville to work for a couple of years at RCA with Chet Atkins. Then he had a spell in Beaumont, Texas, when he hooked up with Jones and wrote She's Just a Girl I Used to Know for him. Around that time he also produced Johnny Cash's Ring of Fire (1963, another country No 1) and wrote Bobby Bare's hit Miller's Cave. In 1965 he returned to Nashville, where his support of the young African-American country singer Charley Pride led to Atkins signing him to RCA – a controversial step at the time. Clement wrote some of Pride's early singles and produced or co-produced a dozen of his albums. He also formed a publishing company that would house many hit songs by himself and other writers.
In the 1970s, with his label JMI, Clement had a productive relationship with the singer Don Williams, for whose song Come Early Morning he devised what has been called the first country music video. In 1978 he released an LP of his own, All I Want to Do in Life. There would be a second album, Guess Things Happen That Way, though his admirers had to wait 33 years for it.
During the 80s, the recording studio that Clements had at his home in Nashville, known as the Cowboy Arms Hotel and Recording Spa, was popular with both country and rock artists. Some of U2's 1988 album Rattle and Hum was recorded there, including their collaboration with BB King, When Love Comes to Town. Clement liked to recall hanging out with Bono, picking and singing old Cash songs.
"Cowboy Jack" was elected to the Nashville Songwriters Hall of Fame and the Rockabilly Hall of Fame, was the first artist-in-residence at the Country Music Hall of Fame & Museum (2002), and received a lifetime achievement award from the Americana Music Association (2004). Some of his notable collection of home-movie footage appeared in a documentary about him, Shakespeare Was a Big George Jones Fan (2005).
The Cowboy Arms was destroyed in a fire in 2011, but Clement continued to work in production. In January, at a concert in Nashville, fellow country musicians gathered to acknowledge him, among them Emmylou Harris, Kris Kristofferson, Rodney Crowell and T-Bone Burnett, with whom he had worked on the soundtrack of the Cash biopic Walk the Line (2005). In October he was to have been officially inducted into the Country Music Hall of Fame.
He is survived by his partner, Aleene Jackson, daughter, Alison, and son, Niles.
• "Cowboy" Jack Henderson Clement, country music producer and songwriter, born 5 April 1931; died 8 August 2013