Edward Bunker, 71, the former convict-turned-literary icon whose hard-edged crime novels reflected the equally hard edges of a life that included spending nearly two decades as an inmate in some of the country's toughest prisons, died July 19 at a hospital in Burbank, Calif. He had complications after surgery to improve the circulation in his legs.

Mr. Bunker had spent the majority of his rebellious and criminal youth in Los Angeles in a succession of foster homes and reform schools.

Often homeless and living by his wits on the streets, he was 14 when he received his first criminal conviction, for burglary, thus launching what he later called his "full-scale war on authority." Years later, a prison psychologist described Mr. Bunker, a habitual criminal, as a "pitiful, tormented and tormenting individual."

At 17, after stabbing a youth prison guard and later escaping from Los Angeles County Jail where he was serving a sentence for another crime, Mr. Bunker became the youngest inmate at San Quentin State Prison. There -- and at Folsom State Prison and other facilities during three terms behind bars that totaled 18 years for robbery, check forgery and other crimes -- he learned to write.

In 1973, still in prison and having written five unpublished novels and scores of unpublished short stories, he made his literary debut with "No Beast So Fierce," a gripping crime novel about a paroled thief whose attempt to reenter mainstream society fails.

Crime-fiction master James Ellroy called the book, which was firmly rooted in Mr. Bunker's own experiences, "Quite simply, one of the great crime novels of the past 30 years; perhaps the best novel of the Los Angeles underworld ever written."

"No Beast So Fierce" was turned into the 1978 movie "Straight Time," starring Dustin Hoffman, with a script co-written by Mr. Bunker. He also played a small part in the film as a criminal who meets Hoffman in a bar and plans a heist for him.

Since then, Mr. Bunker had parallel careers as an actor and writer.

He wrote three more uncompromisingly realistic novels of criminality and life behind bars, "The Animal Factory," "Little Boy Blue" and "Dog Eat Dog."

He also co-wrote the screenplay for "Runaway Train," a 1985 action drama about two escaped convicts played by Jon Voight and Eric Roberts. And he co-wrote the adaptation of his novel for "Animal Factory," Steve Buscemi's 2000 prison-drama starring Willem Dafoe.

Among the most notable of his nearly two dozen parts in films was the role of the criminal Mr. Blue in Quentin Tarantino's 1992 crime-drama "Reservoir Dogs." Most recently, he played a convict in the remake of "The Longest Yard."

Mr. Bunker's last published book is his 2000 memoir, "Education of a Felon," which features an introduction by Pulitzer Prize-winning novelist William Styron, who praised the author as "an artist with a unique and compelling voice."

Mr. Bunker was born in Hollywood in 1933. His mother was a chorus girl in vaudeville and Busby Berkeley musicals, and his father was a stagehand and occasional studio grip. He also was an alcoholic.

After his parents divorced when Mr. Bunker was 4, he spent the next six years in and out of foster homes and military academies, from which he frequently ran away.

By 12, he was living in the first of a series of juvenile reform schools.

While in reform schools, Mr. Bunker had became a voracious reader and, at San Quentin, he found further escape "from the misery of my world" in books.

About a year after Mr. Bunker was sent to San Quentin, fellow inmate Caryl Chessman, the notorious "Red-Light Bandit," published his book "Cell 2455, Death Row."

"It was a revelation to me that a convict could write a book and have it published," Mr. Bunker later said.

Louise Wallis, the wife of producer Hal Wallis and a prominent benefactor of the McKinley Home for Boys who had befriended Mr. Bunker, sent him a portable typewriter, a dictionary, a thesaurus and a subscription to the Sunday edition of the New York Times, whose Book Review he devoured.

He also subscribed to Writer's Digest and enrolled in a correspondence course in freshman English from the University of California for which he sold blood to pay for the postage.

His marriage to Jennifer Bunker ended in divorce. Survivors include a son.

Edward Bunker, shown in jail in 1996, turned his prison experience into a writing and acting career.