Andy Griffith, whose downhome Southern charm suffused many of the characters he played on television, film and stage, died Tuesday at his home on Roanoke Island, N.C., following a long illness. He was 86.

Perhaps best known for his TV roles as good-natured small-town sheriff Andy Taylor in “The Andy Griffith Show” and as a wily defense attorney in “Matlock,” Griffith first found fame in the mid- to late 1950s with the Broadway and film versions of comedy “No Time for Sergeants” and in Elia Kazan’s drama “A Face in the Crowd.”

Griffith became a household name thanks to his eponymous half-hour series on CBS, which debuted in 1960 and ran for eight years.

In the skein, Griffith played a widower and single father to young son Opie (played by Ron Howard). Griffith’s character was the stable element around which a crew of quirky characters revolved, including Don Knotts’ zany deputy Barney Fife. The comedy idealized rural America in the same way that “Father Knows Best” and “Leave It to Beaver” did suburbia, and it set a tone for TV comedies to this day.

The series, with its signature whistling theme song, ran for 249 episodes, going from B&W to color. Reruns still air on TV Land, which ran a marathon of “The Andy Griffith Show” on Wednesday in memory of the star.

Howard, speaking to Variety in a 2010 article commemorating the show’s 50th anni, talked about Griffith’s approach to the skein. “Other shows that depicted the South at the time … played up their characters as bumpkins. (Griffith) didn’t want to take that direction. … (Exec producer) Sheldon Leonard and Andy wanted to infuse the show with values of decency, optimism, order and Americana while still depicting people’s foibles and pettiness.”

Director-producer Jeffrey Hayden, who helmed episodes of “The Andy Griffith Show,” echoed those sentiments, calling Griffith “far and away one of the most talented, sweetest actors I worked with over many years in episodic television. Directing that show was a joy from beginning to end. … It wasn’t just Andy’s rural background but his understanding of the frailties and foibles of our lives. He spoke to small towns, to big cities and everything in between; he spoke a universal language.”

Andrew Samuel Griffith was born in Mount Airy, N.C. While a pre-divinity student at the U. of North Carolina in Chapel Hill, he decided to change his major to music.

After graduating in 1949, he taught high school English for a few years while performing in his free time. He and his first wife, Barbara Edwards, put together an act in which Griffith played a preacher. It was while performing as that preacher at a convention in 1953 that he recorded “What It Was, Was Football,” the comic first impressions of a sport the clergyman had never seen. More than 800,000 albums were sold.

An attempt to break into legit show business in New York proved frustrating, and Griffith soon went back to performing in North Carolina. But none other than Ed Sullivan took a shine to Griffith’s monologues and gave him a break on his television show.

Griffith fought hard for and won a role as a country bumpkin in the armed forces in Ira Levin’s 1955 Broadway comedy “No Time for Sergeants” (he was nominated for a Tony) and played the part again in the 1958 film version.

But his first and greatest film role came in Kazan’s “A Face in the Crowd.” He played a wily and dangerously seductive country boy who rises to stardom on television and aspires to political office.

Variety reviewed his performance on May 28, 1957: “Making his film debut as Lonesome Rhodes, the power-mad hillbilly, Griffith turns in a performance that can easily skyrocket him to the fame of Kazan’s previous discoveries.”

Though not a box office success, the film, which co-starred Patricia Neal and Lee Remick, came to be regarded as one of Kazan’s best.

After the middling pic “Onionhead” in 1958, Griffith returned to Broadway in a musical version of “Destry Rides Again” that ran for more than a year. He received his second Tony nomination for his work on the tuner.

But it was on television that Griffith left his indelible mark. On Oct. 3, 1960, Griffith and youngster Ron Howard whistled their way through the opening credits of “The Andy Griffith Show.” By its third season it was running day (in reruns) and night, and did so until 1968. After leaving the series, he exec produced the spinoff “Mayberry RFD,” which ran until 1971.

In 1972, he started his own production company, Andy Griffith Enterprises.

After again trying his hand at movies with 1969’s “Angel in My Pocket,” he continued to work on television in specials, telepics and miniseries (“Washington Behind Closed Doors,” “Centennial,” “Murder in Texas,” the last of which earned him an Emmy nomination) as well as in nightclubs.

His attempts to get back into series television — “The Headmaster,” “The New Andy Griffith Show,” “Salvage 1” and “The Yeagers” — were unsuccessful, but “Matlock” took off in 1986. It aired on NBC until 1992 and then on ABC until 1995.

Of his occasional film work, 1975’s “Hearts of the West” was an on-target satire of pre-sound Hollywood while the 1985 Western comedy “Rustler’s Rhapsody” left a great deal to be desired. He played the villain in the 1996 spoof “Spy Hard,” the family patriarch in Billy Bob Thornton’s “Daddy and Them” (2001) and the sage owner of the diner in Adrienne Shelly’s well-regarded 2007 film “Waitress.” Griffith certainly showed that he was a good sport in the 2009 sex comedy “Play the Game.”

In addition to his lengthy acting career, Griffith was an accomplished singer, winning a Grammy in 1996 for the gospel album “I Love to Tell the Story — 25 Timeless Hymns.”

He was awarded the Presidential Medal of Freedom by President George W. Bush in 2005.

Griffith was buried on Roanoke Island five hours after his death, according to the Andy Griffith Museum in Mount Airy, which also noted that his favorite causes were Outer Banks Conservationists and the Griffith Scholarship Fund at UNC-Chapel Hill.

Griffith is survived by his third wife, Cindi Knight, whom he married in 1983, and an adopted daughter from his first marriage. An adopted son died in 1996.

(Carmel Dagan and Richard Natale contributed to this report.)