Actor Jim Nabors, whose portrayal of the grinning country bumpkin Gomer Pyle on the 1960s television hit "The Andy Griffith Show" belied a classic baritone singing voice, died on Thursday at the age of 87, his website said.

Nabors, who later became a star with his own television show "Gomer Pyle, USMC," died at his home in Hawaii, the website said, citing his office manager.

The Honolulu Star-Advertiser reported that Nabors had been in declining health for the last few years. He had entered a hospital on Wednesday for tests and asked to be released to go home, his husband Stan Cadwallader told the newspaper.

Nabors' show business break came in the early 1960s when Andy Griffith saw him in a Los Angeles cabaret - singing in a sophisticated, ear-grabbing voice and telling stories between songs in a Deep South drawl - and offered him a part on "The Andy Griffith Show."

Griffith's sitcom - tales of down-home people in a slow-moving Southern town - was one of the most popular on U.S. television at the time and Nabors' Gomer Pyle character was a hit after joining the cast in 1962.

Gomer was the town's rustic, kind-hearted gas station attendant who was given to exclamations of "golly" and "shazam" when he was impressed, as well as "surprise, surprise, surprise" and "shame, shame, shame" - depending on the circumstances and stretching each word to several syllables.

After two years on the Griffith show, Nabors was given his own sitcom, "Gomer Pyle, USMC," with Gomer enlisting in the U.S. Marine Corps. It proved to be a viewers' favorite, sometimes reaching No. 1 in the Nielsen ratings.

As a Marine, Private Pyle was a major screw-up and always at odds with his no-nonsense sergeant. Through it all, he remained pure of heart, sunny of disposition and simple of mind.

After five years of "Gomer Pyle, USMC" Nabors was ready for a different challenge and left the show. His subsequent variety show, "The Jim Nabors Hour," had a two-year run and he made frequent guest appearances on other television shows.

GOMER STEREOTYPE

Nabors was so strongly identified as Gomer that it limited the roles he was offered. His career was helped along by friend Burt Reynolds, who put him in three of his 1980s movies - "The Best Little Whorehouse in Texas," "Stroker Ace" and "Cannonball Run II."

In 1986 Nabors revived Gomer for the TV movie "Return to Mayberry," a reunion of "The Andy Griffith Show," and he kept busy performing in revues, nightclubs and small theaters. Nabors also appeared in several children's television shows and frequently appeared on friend Carol Burnett's variety show.

When he wasn't acting, Nabors was singing in a glorious baritone that made listeners forget all about Gomer Pyle's hayseed twang. He recorded dozens of albums of country, inspirational and religious music with five of them selling more than 500,000 copies.

Nabors made headlines in January 2013 when he married Cadwallader, a former Honolulu firefighter and his partner of 38 years at that time, in Seattle shortly after the state of Washington made same-sex marriage legal.

Nabors, who moved to Hawaii in the 1980s, told Hawaii News Now that his television colleagues knew he was gay in the 1960s and '70s but that he never sought to publicize it because he preferred privacy.

"It's pretty obvious that we had no rights as a couple, yet when you've been together 38 years, I think something's got to happen there, you've got to solidify something," Nabors said of his marriage. "And at my age, it's probably the best thing to do."

Nabors was born June 12, 1930, and grew up in Sylacauga, Alabama, where his father was a police officer. After graduating from the University of Alabama with a business degree, he moved to New York and took a job as a typist at the United Nations. From there, he went to Chattanooga, Tennessee, and worked as a film editor for a television station.

Another film editing job took him to Los Angeles, where he spent off-hours performing at the cabaret where Griffith spotted him.

After the peak of his entertainment career Nabors concentrated on growing macadamia nuts at his farm on the Hawaiian island of Maui.

In February 1994 Nabors suffered from hepatitis B and underwent a liver transplant. He said he contracted the virus several years before in India but it had remained dormant. He underwent heart surgery in June 2012.

Nabors was a fixture at the Indianapolis 500, singing "Back Home Again in Indiana" at the motor race's opening ceremony more than 35 times.

While Gomer Pyle never rose above the rank of private on television, the Marine Corps made Nabors an honorary Marine with the rank of lance corporal in 2001. He was promoted to full corporal in 2007.