If Sam Spade was a tough guy, Jim Rockford was … well, he could throw a punch, but he didn't like to because it hurt his hand.

Rockford's idea of a good time was eating Oreos and fishing with his dad, not spending a lost weekend with some smoky blonde. And tough talk just wasn't his thing; when some hood was beating the tar out of him, Rockford sputtered, "Does your mother have any idea what you do for a living?"

Still, the perennially broke investigator always managed to set things right, and by the end of every episode of "The Rockford Files," Rockford — a.k.a. actor James Garner — also gave viewers something they weren't getting from other tough guy heroes: laughs.

Garner, a master of light comedy who won an Emmy as Rockford and earlier had shot to fame as a charming and dry-witted gambler on the hit TV western "Maverick," died Saturday at his Los Angeles home. He was 86.

Garner's death was confirmed by his publicist, Jennifer Allen. He underwent quintuple bypass surgery in 1988 and suffered a stroke in 2008, but the cause of his death was not immediately known.

As both Maverick and Rockford, Garner "embodied the crusty, sardonic and self-effacing strain of American masculinity," Washington Post TV critic Tom Shales once wrote.

He also was stubborn.

Garner resisted when a studio executive, nervous about ratings, ordered him to dial back Rockford's humor.

"Humor is what I do best," he told the honcho. "That's what people hire me for.... I'm not going to change at the whim of somebody with no experience and no judgment, so either fire me or don't mess with it."

"I might have raised my voice a little," Garner recalled in his 2011 book, "The Garner Files: A Memoir." "I may have even broken one or two small pieces of furniture."

The Oklahoma-born Garner amassed more than 80 film and TV-movie credits during his half-century career.

An off-screen Hollywood maverick who successfully battled two studios in court, he easily moved between small screen and big screen in roles ranging from light comedy to drama.

"I have long thought that Jim Garner was one of the best actors around," filmmaker Robert Altman, who directed him in the 1980 comedy "Health," told Esquire magazine in 1979.

"He is often overlooked because he makes it look so easy," Altman said, "and that is not easy to do."

Garner was nominated for an Academy Award for his role as a widowed small-town pharmacist opposite Sally Field's much younger single mother in the 1985 romantic comedy "Murphy's Romance."

His films include "The Children's Hour," "The Great Escape," "The Americanization of Emily," "The Thrill of It All," "Move Over, Darling," "Grand Prix," "Support Your Local Sheriff," "Marlowe," "Victor/Victoria," "Space Cowboys" and "The Notebook."

But it was television — including stints as a celebrity pitchman for the Beef Industry Council and, most famously, Polaroid cameras — that made Garner a household name.

Garner's seemingly effortless flair for delivering humorous dialogue — and delivering straight dialogue humorously — made him one of television's biggest stars.

"Television is a close-up, intimate medium: The audience falls in love with Jim as a friend," Brandon Stoddard, then a senior vice president of ABC, told Esquire magazine in 1979.

Actress Julie Andrews, with whom Garner starred in "The Americanization of Emily" (1964) and "Victor/Victoria" (1982), agreed.