Country music legend Merle Haggard, who was known for hits like "Okie From Muskogee" and "Mama Tried," died on his 79th birthday.

Haggard's manager, Frank Mull, said the country icon died in Palo Cedro, California, of pneumonia that he had been battling for months. He had kept up an ambitious touring schedule, but the pneumonia in both lungs had forced him to cancel several shows this year.

Born outside of Bakersfield, California, in 1937, Haggard, the son of Oklahoma migrants, was raised in a converted railway boxcar, the only home his family could afford. Famous for his prison stint in San Quentin, Haggard said music was his only opportunity out of poverty.

"My decisions have been easy," he told the Associated Press in 2014. "It was either back in the cotton patch or go to work in the oil fields. ... They didn't compare with music. I was able to make more money in a beer joint when I first started than I was digging ditches."

The gruff, baritone-voiced singer became known for his classic tunes about drifters, convicts and blue collar workers, including "Workin' Man Blues." His tunes celebrated outlaws, underdogs and had an abiding sense of national pride. But he said back in 2014 that after writing some 700 songs, it's hard to find a subject he hasn't written about yet.

A masterful guitarist, fiddler and songwriter as well as singer, the Country Music Hall of Famer recorded for more than 40 years, releasing dozens of albums and No. 1 hits.

Few faces in country were as recognizable as Haggard's, with its wary, sideways glance and chiseled, haunted features that seemed to bear every scar from his past.

Haggard — along with fellow California country star Buck Owens — was a founder of the twangy Bakersfield Sound, a direct contrast to the smooth, string-laden country records popular in Nashville, Tenn., in the 1960s.

General audiences knew him best for "Okie From Muskogee," a patriotic anthem released in 1969 at the height of the Vietnam War that quickly became a cultural touchstone for its anti-hippie lyrics proclaiming "we don't burn our draft cards down on Main Street; we like living right and being free."

"Okie from Muskogee" made him a hero among conservatives, but he softened on the counterculture and released the lighthearted "Big Time Annie's Square," a tribute to a hippie girl and her "crazy world." More recently, he was a backer of prominent Democrats. In 2007 he unveiled a song to promote Hillary Clinton and two years later he penned "Hopes Are High" to commemorate Obama's inauguration. In "America First," he even opposed the Iraq War, singing "Let's get out of Iraq, and get back on track."

In 1970, Haggard was named entertainer of the year by the Country Music Association, and "Okie From Muskogee" won best album and single. The No. 1 hits "Mama Tried" and "Workin' Man Blues" also broke onto the charts around that time, sealing his reputation as one of country's defining voices. He picked up another CMA album of the year in 1972 for "Let Me Tell You About a Song."

Still, Haggard referred to the improvisations of his band, the Strangers, as "country jazz," and in 1980, became the first country artist to appear on the cover of the jazz magazine "Downbeat."

He was inducted into the Country Music Hall of Fame in 1994, the same year he won a Grammy for best male country vocal performance in "That's the Way Love Goes."

Haggard also began headlining at Farm Aid, the benefit founded by his longtime friend Willie Nelson, and started touring with Bob Dylan and the Rolling Stones.

Along with his albums of original songs, he recorded tributes to such early influences as country pioneer Jimmy Rodgers and Western swing king Bob Wills, and paired up with Nelson and George Jones among others. He also resisted the slick arrangements favored by some pop-country stars.

"I'll tell you what the public likes more than anything," he told the Boston Globe in 1999. "It's the most rare commodity in the world — honesty."

The Byrds, Lynyrd Skynyrd, Grateful Dead, Emmylou Harris, Dwight Yoakam, Lucinda Williams and Reba McEntire all covered his songs, while many others paid tribute to him in theirs. In the Dixie Chicks' "Long Time Gone, which criticizes Nashville trends, the trio crooned: "We listen to the radio to hear what's cookin' / But the music ain't got no soul / Now they sound tired but they don't sound Haggard."

His childhood was out of a John Steinbeck novel; his family migrated from Oklahoma to California and lived as outsiders in their adopted state. Born in 1937 near Bakersfield, Haggard was raised in a converted railway boxcar, the only dwelling his parents could afford. When Haggard was 9, his beloved father suddenly fell ill and died, leaving Haggard with lasting grief. He turned to petty crime and spent several years in and out of institutions.

He served three years in San Quentin as inmate 845200 for burglarizing a cafe during a drunken spree. It was during that stint he saw Johnny Cash play, and he returned to Bakersfield at age 22 in 1960 ready to write music. Singer-bandleader Wynn Stewart was an early patron, hiring Haggard to play bass in his group. Haggard's first hit was a cover of Stewart's "Sing a Sad Song" and by 1966 he had been voted most promising vocalist by the Academy of Country and Western Music. He became a superstar in 1967, first with a cover of Liz Anderson's "I'm a Lonesome Fugitive," then with such originals as "Sing Me Back Home" and "The Legend of Bonnie and Clyde," featuring Glen Campbell on banjo.

Fame brought him unexpected respectability. His criminal record was erased by then-Gov. Ronald Reagan, who pardoned him in 1972, and he was invited by President Richard Nixon to sing at the White House. Officials in Kern County, where he spent his boyhood years, have since honored his legacy by renaming a portion of road Merle Haggard Drive.

Haggard was active as ever in his 70s, and received strong reviews for his 2010 album "I Am What I Am." He lived his last years outside Redding with his fifth wife, Theresa Lane. Haggard previously was married to singer Leona Williams, and to country crooner Bonnie Owens, the former wife of Buck Owens, with whom he toured for nearly a decade.

His son Ben Haggard shared a picture of what appears to be himself holding his dad's hand following Haggard's death.

Haggard had lung surgery after a cancer diagnosis in 2008, and he said an early, but incorrect, diagnosis had him thinking he had only a short time to live.

The star said of the misdiagnosis, "It was sort of a disappointment. I was ready to go."

The Associated Press contributed to this report.