He cultivated an in-your-face persona with hits like “Who’s Your Daddy?” and “Courtesy of the Red, White and Blue.” He announced in 2022 that he had cancer.

Toby Keith, a bearded man wearing a sports jacket and a cowboy hat, sings into a microphone. He has an acoustic guitar strapped around his shoulder but is not playing it.
Toby Keith performing in Nashville in 2018. His songs ranged from traditional honky-tonk to pop-country balladry and Southern rock. Credit…Jason Kempin/Getty Images

Toby Keith, the larger-than-life singer-songwriter of No. 1 country hits like “Who’s Your Daddy?” and “Made in America” and one of the biggest stars to come out of Nashville in three decades, died on Monday. He was 62.

His death was announced on his official website. Elaine Schock, Mr. Keith’s publicist, said in an email that he died in Oklahoma, where he had lived his entire life.

Mr. Keith announced in the summer of 2022 that he had been diagnosed with stomach cancer and was being treated with chemotherapy, radiation and surgery.

In a recent interview with the Oklahoma City television station KWTV, Mr. Keith, who played a run of shows in Las Vegas in December, said he was still in treatment. “Cancer is a roller coaster,” he said. “You just sit here and wait on it to go away — it may not ever go away.” He said that his Christian faith was helping him get through the treatment and the potential dark outcome.

Singing in an alternately declamatory and crooning baritone, Mr. Keith cultivated a boisterous, in-your-face persona with recordings like “I Wanna Talk About Me” and “Beer for My Horses.”

Built around clever wordplay and droll humor — and more than a little macho bluster — both topped the Billboard country chart, with “Beer for My Horses,” a twangy, Rolling Stones-style rocker that featured Willie Nelson as guest vocalist, crossing over to the pop Top 40.

Mr. Keith wrote or co-wrote most of his material, which ranged stylistically from traditional honky-tonk to pop-country balladry and Southern rock. More than 60 of his singles reached the country chart, including 20 No. 1 hits, and he sold more than 40 million albums worldwide. In 2015 he was inducted into the Songwriters Hall of Fame, a member of a class that included Cyndi Lauper, the blues pioneer Willie Dixon, and Robert Hunter and Jerry Garcia of the Grateful Dead.

Mr. Keith was already in his 30s, having scuffled for years to make it in the music business, when he signed his first record deal in 1993. He had previously worked as a rodeo hand, a roughneck in the Oklahoma oil fields and a semiprofessional football player to support his young family.

“I didn’t take many vacations the first 20 years of my adult life,” Mr. Keith said in a 2018 episode of “The Big Interview With Dan Rather.”

Mr. Keith, wearing a blue work shirt and a black cowboy hat, sits on a chair and smiles at the camera.
Mr. Keith at the Holiday Star Theater in Merrillville, Ind., in 1994.Credit…Paul Natkin/Getty Images

“When I came out and my song hit,” he added, referring to “Should Have Been a Cowboy,” which in 1993 became his first No. 1 country single, “I was doing 28, 29 shows a month because I didn’t know I was going to get a second hit.”

“At the time,” he added, “I was just trying to outwork everybody.”

His vast popularity — and blue-collar bona fides — notwithstanding, Mr. Keith was often a lightning rod for controversy, especially where politics were concerned.

Perhaps the most prominent instance was with “Courtesy of the Red, White and Blue (The Angry American),” which was both a No. 1 country single and a pop crossover hit in 2002. Mr. Keith wrote the song in response to both the 9/11 attacks and the death of his father, a disabled veteran who had been killed in an automobile accident earlier that year.

Delivered with heartland fervor akin to that of Bob Seger and John Mellencamp, the song’s final stanza could be heard as either a patriotic rallying cry or a jingoistic rant, depending on one’s point of view.

Justice will be served and the battle will rage
This big dog will fight when you rattle his cage
And you’ll be sorry that you messed with The U.S. of A.
’Cause we’ll put a boot in your ass. It’s the American way.

Amid other backlash, the record triggered a protracted dispute with Natalie Maines, the lead singer of the Dixie Chicks (now the Chicks), who heard the song as the ugliest sort of nationalism, deriding it as “ignorant” and taking Mr. Keith to task in interviews and onstage.

“I don’t apologize for being patriotic,” Mr. Keith said in a 2007 interview with Newsday.

Fiercely independent, Mr. Keith for years described himself as a conservative Democrat, confounding his critics with seemingly contradictory statements expressing admiration, for example, for the ideologically divergent likes of Donald Trump and Barack Obama. (He later said he had re-registered as an independent voter.)

A particularly disarming instance of Mr. Keith’s contrarian capacity for surprise was his 2003 recording of “If I Was Jesus,” an empathetic rumination, written by Phil Madeira and Chuck Cannon and reminiscent of vintage John Prine.

“If I was Jesus/I’d have some friends that were poor,” he sang over a lilting Caribbean rhythm to open the song’s second stanza. “I’d run around with the wrong crowd/Man, I’d never be bored/Then I’d heal me a blind man, get myself crucified/By politicians and preachers who got something to hide.”

It was enough that Mr. Keith, whose critics dismissed him as a loudmouthed boor, rendered these lines with self-deprecating understatement and good humor. Especially disarming was his suggestion, in keeping with the tenets of liberation theology, that God takes the side of sinners and outcasts.

Inspired by Merle Haggard and other artists of a populist bent, Mr. Keith made music reflecting his roots in the working-class, post-Dust Bowl culture of the Southwestern United States. In recognition of this kinship, he was presented with the 2020 Merle Haggard Spirit Award by the Academy of Country Music.

Toby Keith Covel was born on July 8, 1961, in Clinton, Okla., the second of three children of Carolyn Joan (Ross) Covel and Hubert K. Covel Jr. His father worked as a derrickhand in the oil industry. His mother was an aspiring singer who abandoned her musical pursuits to become a homemaker.

Mr. Keith grew up primarily in Moore, Okla., a suburb of Oklahoma City. He got his first guitar at age 8, and later spent summers with his grandmother in Fort Smith, Ark., doing odd jobs at her supper club and occasionally sitting in with the house band.

After graduating from high school, he worked alongside his father in the oil fields, eventually becoming a supervisor. At 20, he and several friends formed a group called the Easy Money Band and started playing in local bars before graduating to the Texas and Oklahoma roadhouse circuit.

Mr. Keith’s first foray into the Nashville music scene found him busking on street corners and knocking on doors, to no avail, along the city’s Music Row. It was not until a fan who worked as a flight attendant slipped his demo tape to the producer Harold Shedd, known for his work with stars like Reba McEntire and Shania Twain, that he secured a contract with Mercury Records.

His debut album for the label, titled “Toby Keith,” produced four Top 10 country singles and was certified platinum for sales of one million copies.

Determined to have a stronger, more indelible stamp as a performer, Mr. Keith nevertheless grew restless, moving from one subsidiary of Mercury to another before finding a home in 1998 with the newly minted Nashville office of DreamWorks Records. The change proved auspicious: Mr. Keith established a more robust, if fractious, image, and 11 of his next 13 singles, including “How Do You Like Me Now?!” and “I Wanna Talk About Me,” reached No. 1.

A bigger, fuller sound completed this transformation, not only matching Mr. Keith’s outsize persona but also earning him Country Music Association honors for vocalist of the year in 2001 and entertainer of the year nominations in 2002 and 2003.

In 2005 he founded Show Dog Nashville, an independent label, for which he continued to have success, notably with a series of alcohol-themed singles like “Get My Drink On” and “Get Drunk and Be Somebody.” “Red Solo Cup,” a country-rap number, hit No. 1 on the country chart and crossed over to the pop Top 20 in 2011.

Mr. Keith, wearing a black jacket and a white cowboy hat, stands at a microphone and strums a guitar. Willie Nelson, similarly dressed with a black hat, stands next to him.
Mr. Keith was joined by Willie Nelson when he performed “Beer For My Horses” at the American Music Awards in 2003.Credit…M. Caulfield/WireImage

Mr. Keith had acting roles in two feature films, “Broken Bridges” in 2005 and “Beer for My Horses,” a 2008 movie based on his hit single. He also appeared in television commercials for Ford trucks and established profitable restaurant and clothing ventures. He was heralded on the cover of a 2013 issue of Forbes magazine as “Country’s $500 million man.” The accompanying article reported that Mr. Keith’s personal wealth exceeded that of both Jay-Z and Beyoncé.

Mr. Keith’s presence on the charts dwindled as the 2010s wore on. But in 2021 he was a recipient of the National Medal of Arts, along with four others, including the bluegrass singer and mandolinist Ricky Skaggs.

Mr. Keith is survived by his mother; his wife of 39 years, Tricia (Lucus) Keith; two daughters, Shelley Covel and Krystal Sandubrae; a son, Stelen; a sister, Tonnie; a brother, Tracy; and four grandchildren.

For all his belligerence and braggadocio, Mr. Keith demonstrated considerable insight and restraint when, more than a year after it started, he walked away from his contretemps with Ms. Maines over “Courtesy of the Red, White and Blue.”

Having previously attacked Ms. Maines — going so far as to project images of her with those of President Saddam Hussein of Iraq on the stage at his concerts — Mr. Keith all but apologized for his role in the conflict in a 2003 interview with CMT.com.

“It got pretty vicious sometimes,” he said. “I’m embarrassed about the way I let myself get sucked into all that.”

Five years later, a rapprochement seemed imminent when Mr. Keith and the Chicks were recruited to appear in a television commercial in support of former Vice President Al Gore’s “We” campaign to address climate change. Reportedly because of scheduling conflicts, the collaboration never took place.