Merle Haggard, the Grammy Award-winning singer whose autobiographical prison songs and populist political anthems, notably “Mama Tried” and “Okie From Muskogee,” made him one of country music’s most formidable and celebrated entertainers, died April 6 at his home in Palo Cedro, Calif. He died on his 79th birthday.

The cause was complications from pneumonia, said his manager, Frank Mull.

Mr. Haggard was widely regarded as one of the most moving singers in the country genre. John Rumble, senior historian for the Country Music Hall of Fame and Museum, called him “country music’s greatest songwriter, with the arguable exception of Hank Williams. When you think about the vast array of subject matter, it’s astonishing: the realism, the very careful and artful way that he puts songs together, the turns of phrase — it is deceptively simple.”

Along with singers Buck Owens and Wynn Stewart, Mr. Haggard typified country music’s “Bakersfield sound” of the 1960s. The California city, home to many who fled the dust bowls of the 1930s and worked in its oil fields, was a thriving center of country music. Whereas Nashville producers pressured their singers to adopt a “countrypolitan” style with choirs and string sections, Bakersfield built its reputation on a grittier sound and twangy guitars.

Mr. Haggard was best known for his 1969 song “Okie From Muskogee,” which protested the counterculture of the time with such lines as “We don’t smoke marijuana in Muskogee/We don’t take our trips on LSD” and “We don’t burn our draft cards down at the courthouse.”

Country music giant Merle Haggard died April 6, his birthday, at the age of 79. His stripped-down sound and gritty lyrics, often pulling from real-life experiences, would become influential and later known as the "Bakersfield sound." (Erin Patrick O'Connor/The Washington Post)

The song won him an audience at the Nixon White House in 1973. Mr. Haggard later said that he did not intend the song as a political anthem; in fact, he acknowledged his own drug use by stating that he often smoked marijuana before going out on stage.

Between 1966 and 1987, Mr. Haggard had 38 No. 1 country hits, including several drawn from his experiences in the California penal system. Mr. Haggard once described his career in music as a “35-year bus ride,” and a theme of restlessness runs through such compositions such as “The Running Kind” and “Ramblin’ Fever.”

Other songs, such as “Hungry Eyes” and “If We Make It Through December,” were filled with empathy for the working poor — a reflection of his family background. “Today I Started Loving You Again,” a plaintive love song about obsession co-written with Bonnie Owens, became one of the country genre’s most covered songs.

Merle Ronald Haggard was born in Bakersfield, Calif., on April 6, 1937, in a makeshift home that his father built from an abandoned boxcar. Mr. Haggard’s parents left a barren farm in Oklahoma as part of the exodus from the Dust Bowl.

His father, a western swing fiddler and carpenter, died when Merle was 9. While his mother struggled to support the family, Mr. Haggard spent his childhood in a reckless pattern of petty crimes, truancy and narrow escapes from the police, once running away to Texas by hopping freights and stealing cars. By 14, he had escaped from three juvenile facilities.

Glen Campbell, right, appears with, from left, country singers Johnny Cash, Merle Haggard and Buck Owens on "The Glen Campbell Goodtime Hour" in this undated publicity photo. (CMT via AP)

For Mr. Haggard, the one bright spot in this youth was music. After hearing country singer Lefty Frizzell at a local dance hall, Mr. Haggard took up singing and guitar. He prided himself on his ability to mimic Frizzell’s singing style and, by his teens, secured music jobs in local honky tonks.

Prison curtailed these activities. In 1957, he was sentenced to five years in California’s San Quentin State Prison for car theft and burglary.

The burglary charge resulted from an inebriated attempt to pry open the back door of a restaurant in broad daylight. After his apprehension, Mr. Haggard simply walked out of the Bakersfield City Jail.

Having embarrassed the local police with his escape, he was captured at his brother’s house in Lamont, Calif., 25 miles away. Mr. Haggard recalled in his 1999 memoir, “Merle Haggard’s My House of Memories,” written with Tom Carter, that he had been spotted earlier that day in Bakersfield wearing a propeller beanie as a disguise.

While in San Quentin, Mr. Haggard sold home brew to other inmates, an activity that landed him in solitary confinement. Through the walls of solitary, he befriended death row inmates Caryl Chessman and Jimmy “Rabbit” Hendricks. Mr. Haggard said their executions inspired him to change his criminal behavior.

He recalled in his autobiography: “San Quentin was beneficial to me as the army is for some people. I was 20 and full of piss and vinegar with no intention of doing anything right.”

Mr. Haggard was paroled in 1960 and was pardoned by then-California Gov. Ronald Reagan in 1973. On his release from prison, Mr. Haggard performed in Bakersfield and Las Vegas clubs, eventually joining established singers Wynn Stewart and Buck Owens as a bassist and opening singer.

In 1964, Stewart offered Mr. Haggard one of his compositions, “Sing a Sad Song,” for his first recording on a small Bakersfield label, Tally Records. Capitol Records bought Mr. Haggard’s contract when the record made the Top 20 country charts.

After his second release, “All My Friends Are Gonna Be Strangers” (1965), Mr. Haggard put together a touring band, the Strangers, with steel guitarist Norm Hamlet, lead guitarist Roy Nichols and vocalist Bonnie Owens.

Owens, previously married to Buck Owens, became Mr. Haggard’s second wife in 1965. The two divorced in 1978. Bonnie Owens served as a bridesmaid later that year when Mr. Haggard married another backup singer in his band, Leona Williams. Owens and Mr. Haggard continued to perform together after their divorce.

His first marriage, to Leona Hobbs, ended in divorce, as did a later marriage to Debbie Parret. His fifth wife was Theresa Lane. Besides his wife, survivors include four children from his first marriage and two from his fifth marriage; a sister; and many grandchildren.

Mr. Haggard’s first No. 1 hit, “I'm a Lonesome Fugitive” (1967), written by Liz and Casey Anderson, was the first of many songs to allude to a criminal past. Mr. Haggard followed it with similarly themed songs from his own pen.

Perhaps the most memorable of these songs was “Mama Tried,” with its line, “I turned 21 in prison doing life without parole.” The song was later covered by the Grateful Dead and folk singer Joan Baez.

With the success of “Okie From Muskogee” and other conservative anthems such as the hawkish “Fightin’ Side of Me” (1970), Mr. Haggard was given greater artistic freedom by Capitol. He exercised it with several concept and tribute albums.

The album “A Tribute to the Best Damn Fiddler in the World (Or My Salute to Bob Wills)” (1970) featured Mr. Haggard’s versions of songs by western swing bandleader Bob Wills. The record revitalized western swing, a musical hybrid of traditional Southwestern country music and New Orleans jazz, popular in the 1930s.

Mr. Haggard received a Grammy for lifetime achievement in 2006 and a Kennedy Center Honor in 2010. He also won Grammys in 1998 for the Marty Stuart song “Same Old Train” — a collaboration with 12 other country performers — and in 1984 for his version of “That’s the Way Love Goes.” He was inducted into the Country Music Hall of Fame in 1994.

During the past two decades, a new generation of country singers gradually supplanted Mr. Haggard on the radio and in the charts. He was openly hostile about the lack of promotion by record companies and radio.

“Radio doesn’t want substance,” he told The Washington Post. “If a song actually had an opinion, that’s the first thing they’d throw in the trash.”

He remained a favorite of critics, garnering praise for such releases as “If I Can Only Fly” (2000) and “The Bluegrass Session” (2007). In 2005, he surprised many of his listeners with the song “Rebuild America First,” which criticized the U.S. war in Iraq and suggested the money that paid for the war be put into infrastructure needs.

In 2007, he toured and recorded with two other veteran country singers, Willie Nelson and Ray Price, as “the Last of the Breed.” A few months after the tour, surgeons removed a tumor from Mr. Haggard’s right lung. He told reporters afterward that he craved marijuana. He had earlier acknowledged addictions to amphetamines, cocaine and valium.

“Life has been peaks and valleys all the way for me,” Mr. Haggard once told the Toronto Sun. “The only way I know to come out of the valleys is to write my way out.”