Edd Byrnes, a onetime teen heartthrob who parlayed his popularity as the hair-slicking hipster Kookie on the TV detective series “77 Sunset Strip” into a hit 1959 record, “Kookie, Kookie (Lend Me Your Comb),” died Jan. 8 at his home in Santa Monica, Calif. He was 87.

The cause was a stroke, said his son, Logan Byrnes.

Mr. Byrnes, who struggled to escape poverty and a troubled youth by briefly turning to prostitution, began to land small TV and film roles after arriving in Hollywood in the mid-1950s. In one of his films, “Girl on the Run” (1958), he played a killer who was constantly combing his hair — a bit of stage business he said he improvised on the set.

The film, which included Efrem Zimbalist Jr. as a suave detective named Stuart Bailey, was basically a pilot for “77 Sunset Strip,” which premiered on ABC in 1958. The series featured Zimbalist and Roger Smith as Los Angeles private detectives, with Mr. Byrnes as Kookie, a slang-slinging parking-lot attendant.

The stylish, fast-moving show had adult themes, often featuring young women causing or narrowly escaping trouble, and was an immediate success. The jazzy theme song by Mack David and Jerry Livingston became a minor hit:

77 Sunset Strip,

The street that wears the fancy label,

That’s glorified in song and fable.

The most exciting people pass you by,

Including a private eye.

Mr. Byrnes’s Kookie was originally slated for one guest appearance, but he was so popular — particularly with younger viewers — that he became a regular on the show, with third billing on the credits. At first, his role was to jog up as Zimbalist’s character drove into the parking lot in his Thunderbird convertible. Then, often while combing his blond pompadour, he engaged in some hepcat patter as he took the car keys.

He called almost everyone “Dad” and seemed to know, from “the word on the street,” about every scheme and dust-up in the fictional universe of “77 Sunset Strip.”

“Hi, Dad,” he said in one episode, greeting Zimbalist’s Bailey. “Man, I dig how you had yourself a rumble with that Dixon square this a.m.”

Bailey: “There’s not much you don’t dig.”

Kookie: “The way I dig it, you dribbled out of your place looking real bombed out, like traumatized.”

In Kookie-speak, anything desirable — most certainly including charming young women — was “the ginchiest” or “the maximum utmost.”

With his popularity soaring, Mr. Byrnes recorded the novelty song “Kookie, Kookie (Lend Me Your Comb)” with Connie Stevens. It sold more than 1 million copies and reached No. 4 on the Billboard pop chart.

During the second season of “77 Sunset Strip,” Mr. Byrnes demanded a larger role and more money and left the show for several weeks.

As one of the first teen idols of the TV age, Mr. Byrnes was reportedly receiving 15,000 ­of fan mail a week. Eventually, Warner Bros. relented and brought him back to the show as a junior partner to Zimbalist and Smith.

Mr. Byrnes’s studio contract kept him from accepting film offers, including “Oceans Eleven” and “Rio Bravo,” and he said he was turned down for the 1963 film “PT 109,” about John F. Kennedy’s World War II experiences, because of President Kennedy’s objections. (Cliff Robertson got the role.)

After five seasons on “Sunset Strip,” Mr. Byrnes bought out his contract in 1963.

The series ran for one more season, with most of the original cast replaced.

“No more hipster image for me,” Mr. Byrnes said at the time. “From now on I’d like to establish myself as a movie star.”

It was not to be. Even though he had appeared in summer-stock theater, including “Bus Stop” and the challenging Tennessee Williams dramas “Sweet Bird of Youth” and “Cat on a Hot Tin Roof,” he struggled for more than a decade to find anything but bit parts in TV shows and European films.

He found some success with a role as Vince Fontaine, a dance-show host modeled after Dick Clark, in the 1978 movie musical “Grease,” opposite John Travolta and Olivia Newton-John.

In the mid-1970s, Mr. Byrnes filmed two pilot episodes as the host of a new game show created by Merv Griffin, “Wheel of Fortune.” NBC executives wanted a different host, and the job went instead to Chuck Woolery and later Pat Sajak.

As his stardom faded, Mr. Byrnes fell into a tailspin of drugs and alcohol before regaining his sobriety in the early 1980s.

Edward Byrne Breitenberger was born July 30, 1932, in New York City. His father was an abusive alcoholic who died of a head injury — possibly in a fall, possibly by violence — when his son was in his early teens. His mother worked an assortment of odd jobs.

Mr. Byrnes began using his middle name (with an added “s”) about the time he dropped out of school at 15. In a 1996 autobiography written with Marshall Terrill, “Kookie No More,” he said he worked as a taxi driver and a photographer’s model, which led to a period of prostitution with older men.

Although he considered himself heterosexual, he entered a “strange world,” he wrote, of “art, wealth, sadism, limousines, sex for money, theater and fine restaurants.”

In 1955, with $300 to his name, he drove to Hollywood. Under the name Edward Byrnes — he later decided on “Edd” — he had a supporting role in “Marjorie Morningstar,” a 1958 film starring Gene Kelly and Natalie Wood, but he more typically appeared in TV westerns or teen sexploitation movies with such titles as “Johnny Trouble,” “Life Begins at 17” and “Reform School Girl.”

His marriage to actress Asa Maynor ended in divorce. Survivors include their son, Logan Byrnes, a TV news anchor in San Diego; his longtime partner, Catherine Gross; a sister; and a brother.

Mr. Byrnes went on to appear in occasional films, such as “Troop Beverly Hills” (1989) with Shelley Long, and in several TV series, including “Police Woman,” “The Love Boat” and “Murder, She Wrote.”

But he could never escape the persona of Kookie, and as recently as 2005 he was ranked No. 5 among “TV’s greatest teen idols” by TV Guide magazine. He came to understand that much of the world knew him as “Edd Kookie Byrnes.”

“People think that’s the only part you can play,” he once told the Los Angeles Times.

“The name,” he said, “is Edd Byrnes.”