Legendary country singer Mac Davis, who famously wrote Elvis Presley’s “In the Ghetto” has died at the age of 78, reported CNN.

According to the Guardian, he suffered complications following a heart surgery. His manager Jim Morey announced his death, saying Davis was surrounded by his wife and three sons. “He was a music legend but his most important work was that as a loving husband, father, grandfather and friend,” said his manager.

“I will miss laughing about our many adventures on the road and his insightful sense of humor. When there was a tough decision to be made he often told me ‘You decide.. I’m going to the golf course!'”, read Morey’s Facebook post.

Morey ended his Facebook statement with the lyrics from Davis’ song ‘I Believe In Music’.

News of Davis’ death comes days after his family said he had become “critically ill” after undergoing heart surgery in Nashville.

Initially, Davis found fame writing hits like ‘A Little Less Conversation’ and ‘In The Ghetto’. 

However, Davis — originally Morris Mac Davis — made his country music debut with his 1970 album ‘Song Painter’.

His breakthrough album ‘Baby, Don’t Get Hooked On Me’ was released two years later.

Social media was flooded with tribute posts remembering the musician, who was honored with a star on the Hollywood Walk of Fame in 1998. 

Singer Richard Marx tweeted: “This is such a drag. RIP to the incredible #MacDavis. Thank you for your incredible songs and your kindness to me. It was an honor to hear you tell me stories.”

Davis, whose hits include ‘Stop and Smell the Roses’ and ‘One Hell of a Woman’, not only was an incredible musician, but also a witty man. 

Remembering one of his anecdotes, fellow country musician Travis Tritt posted, “Mac Davis was once asked by a TV audience member to write a song about a rubber duck. He instantly wrote: “I was sitting in the bathtub when my toe got stuck. The jerk I made caused a tidal wave and squashed my rubber duck!” Funny guy with a tremendously quick wit.”

In 2000, Davis was inducted into the Nashville Songwriters Hall of Fame in and the national Songwriters Hall of Fame in 2006.

In 2013, he topped Billboard’s Dance Club Songs chart as co-writer on Avicii‘s ‘Addicted to You’.

Along with his musical accomplishments, Davis hosted his own series ‘The Mac Davis Show’ on NBC from 1974 to 1976 and also starred in TV movies ‘Beer For My Horses’ and ‘Where The Fast Lane Ends’.