Sam Peckinpah, the director known for his graphic depictions of violence in such films as "The Wild Bunch," "Straw Dogs" and "Bring Me the Head of Alfredo Garcia," died yesterday of cardiac arrest. He was 59.

Mr. Peckinpah died at Centinela Hospital Medical Center in Los Angeles, where he had been flown Thursday from Mexico after doctors discovered a blood clot in a lung, said Nancy Galloway, a longtime aide to the controversial and outspoken film director.

Mr. Peckinpah, who had a history of heart trouble, died at 9:49 a.m., according to a hospital spokesman. His former wife, Begonia Palacios, was with him at his death.

"He had a heart attack three or four years ago and he was wearing a pacemaker," said his brother, retired Fresno County Superior Court Judge Denver Peckinpah. "He kept feeling under the weather in Mexico, so they flew him up Thursday night. He had a cardiac arrest and didn't come out of it."

At the time of his death, Mr. Peckinpah was in pre-production on an independent film, "On the Rocks," to be shot in San Francisco.

Born Feb. 21, 1925 in Fresno, Calif., Mr. Peckinpah grew up on a large family ranch, and the exhilarating memories of hunting, riding and fishing in the Sierra foothills informed his work.

After graduating from San Rafael Military Academy, Mr. Peckinpah served with the U.S. Marines in China. While attending college in Fresno after World War II, his courtship of his first wife, student actress Cecilia Selland, led him to a directing class. "It just turned me on right away," he told Playboy magazine in 1972.

Mr. Peckinpah, whose rugged, grizzled appearance and flat dry voice recalled the classic "desert rat" seen in so many of his films, graduated from the University of Southern California with a master's degree in theater arts.

He directed summer stock productions and eventually gravitated to television in the mid-1950s, where he wrote for and occasionally directed episodes of "Gunsmoke," "Broken Arrow," "The Rifleman" and "The Westerner," a series that he originated and directed. These shows established Mr. Peckinpah's career as a "western specialist."

He made his feature film debut in 1961 with "The Deadly Companions," and is most fondly remembered for several elegiac Westerns, "Ride the High Country" (1962) and "The Ballad of Cable Hogue" (1970), though it was the "Wild Bunch" (1969) and "Straw Dogs" (1971) that cemented his reputation as the "master of violence."

His other films included "Major Dundee" (1965), "The Getaway" and "Junior Bonner" (both 1972), "Pat Garrett and Billy the Kid" (1973), "Bring Me the Head of Alfredo Garcia" (1974), "The Killer Elite" (1976), "Cross of Iron" (1977), "Convoy" (1978) and "The Osterman Weekend" (1983). Most of his recent films were box-office failures.

Mr. Peckinpah directed two music videos for Julian Lennon, son of the late Beatle John Lennon, including the recent "Valotte" production.

In his career, Mr. Peckinpah developed a reputation as a maverick stylist and personality, a throwback to the crusty filmmaker whose idiosyncratic vision often seemed out of step with commercial trends and considerations. At one point in the mid-1960s, his reputation as a "troublesome" director led to his being blackballed in Hollywood and on television. His quarrels with Hollywood producers and studio executives were as legendary as his tough visual style and his hard-drinking, two-fisted personal life. Not surprisingly, the theme of doomed outlaw figures waging a fierce but losing battle against impossible odds coursed through his films.

Two years after directing an acclaimed television drama of Katherine Anne Porter's "Noon Wine," Mr. Peckinpah made a triumphant movie comeback with "The Wild Bunch," described by Life magazine as "the first masterpiece in the new tradition of 'the dirty western.' "

The moral ambiguities that clouded so many of Mr. Peckinpah's films were at least partly rooted in the judicial/familial tradition that saw his grandfather, father and brother all become judges.

"I grew up with all those judges and it was law and order, honor, truth, and justice from morning till night," Mr. Peckinpah told an interviewer in 1969. "I just sat there listening and then I started to question. What do they mean? Is there such a thing as a good that leads to evil? I think there is . . . I'm not a pessimist, but I've learned to question. That's what most of my films are about."

Mr. Peckinpah is survived by his brother and a sister, Fern Lea Peter. His marriage to Cecilia Selland ended in divorce in 1962. They had four children. Begonia Palacios was his third wife, and they married and divorced three times, his brother said. They had a daughter, Lupita, 11.