Jim Nabors, whose name is synonymous with the genial bumpkin Gomer Pyle, whom he played on TV, has died. He was 87.

His husband, Stan Cadwallader, told the Associated Press that Nabors died on Thursday at their home in Hawaii.

He brought the words “golly” and “shazam” into the vernacular as the naive, well-intentioned Pyle, a regular character on “The Andy Griffith Show” that was later the focus of spinoff “Gomer Pyle, U.S.M.C.” Pyle was a loving caricature of a Southern rube, completely out of step with the ’60s and all the more lovable for it. The series ran for four seasons, and Nabors’ 20% cut of the syndication revenue for the popular series made him financially secure thereafter and able to pursue broader interests as a singer and comic raconteur.

Later attempts at a variety show did not last long, however, either on network TV or in firstrun syndication, though Nabors was a popular headliner on the Vegas-Reno nightclub circuit.

Nabors was discovered singing at the Horn cabaret in Santa Monica by writer-comedian Bill Dana, who booked Nabors for occasional stints on “The Steve Allen Show.”

In the early ’60s, he began to appear regularly on “The Andy Griffith Show” as the ingenuous gas station attendant Gomer Pyle, which led to his own CBS series, produced by Griffith, about Pyle’s misadventures after joining the Marines, about which the New York Times wrote, “Mr. Nabors conveys a particular mood of attractive awkwardness, and naivete, a contagious quality of special poignancy rooted in laughter.”

The program shot into the top 10 in the Nielsen ratings, where it stayed for its entire four seasons.

During that time, Nabors starred in a number of variety specials for CBS including “Friends and Nabors,” which attracted an audience of 33.9 million, and guested on shows for Danny Thomas and the Smothers Brothers. He entertained onstage in Vegas, Reno and Tahoe, and his first album, “Jim Nabors Sings,” sold a million copies. By 1967 he was earning $500,000 annually.

Although it was too late to ever completely dissociate himself from Gomer Pyle, Nabors decided to end the series in 1969, while it was still rated in the top five. He hosted variety program “The Jim Nabors Hour” for two seasons on CBS and, in the late ’70s, tried it again in syndication, though “The Jim Nabors Show” was more of a combination comedy/talk program.

During this period he toured almost year round, reaping the benefits of his natural baritone voice, his disarming Southern-boy personality and his high name recognition from television. For a time he lived in Honolulu near his close friend Carol Burnett and starred in “The Jim Nabors Polynesian Extravaganza” at the Hilton Hawaiian Village for two years.

Film roles were few, mostly cameo and supporting appearances in three Burt Reynolds vehicles, “The Best Little Whorehouse in Texas,” “Stroker Ace” and “Cannonball Run II.”

Nabors recorded more than two dozen albums. At least four were certified gold by the RIAA, the most recent of which was “Jim Nabors Christmas Album” in 1990.

James Thurston Nabors was born in Sylacauga, Ala. Chronic asthma resulted in a childhood of forced seclusion, and after graduation from the U. of Alabama, he lived for a time in New York, working as a typist at the United Nations. The recurring asthma problems forced him to return home, where he worked as an assistant film editor for a television station in Chattanooga, Tenn., and also sang occasionally on the station’s daytime shows.

After moving to Los Angeles, he continued to work as an editor and entertained for free in the evenings — performing operatic arias interspersed with monologues — until his discovery and subsequent work in television.

Nabors converted to Catholicism in the mid-’60s.

He married his partner of 38 years, Stan Cadwallader, in Washington in 2013 a month after gay marriage became legal in that state.

In addition to Cadwallader, he is survived by two sisters, Freddie and Ruth.