Chuck Berry, who with his indelible guitar licks, brash self-confidence and memorable songs about cars, girls and wild dance parties did as much as anyone to define rock ’n’ roll’s potential and attitude in its early years, died on Saturday at his home near Wentzville, Mo. He was 90.

The St. Charles County Police Department confirmed his death on its Facebook page. The department said that it responded to a medical emergency at the home, about 45 miles west of St. Louis, and that lifesaving measures were unsuccessful.

While Elvis Presley was rock’s first pop star and teenage heartthrob, Mr. Berry was its master theorist and conceptual genius, the songwriter who understood what the kids wanted before they knew themselves. With songs like “Johnny B. Goode” and “Roll Over Beethoven,” he gave his listeners more than they knew they were getting from jukebox entertainment.

His guitar lines wired the lean twang of country and the bite of the blues into phrases with both a streamlined trajectory and a long memory. And tucked into the lighthearted, telegraphic narratives that he sang with such clear enunciation was a sly defiance, upending convention to claim the pleasures of the moment.

In “Sweet Little Sixteen,” “You Can’t Catch Me” and other songs, Mr. Berry invented rock as a music of teenage wishes fulfilled and good times (even with cops in pursuit). In “Promised Land,” “Too Much Monkey Business” and “Brown Eyed Handsome Man,” he celebrated and satirized America’s opportunities and class tensions. His rock ’n’ roll was a music of joyful lusts, laughed-off tensions and gleefully shattered icons.

Mr. Berry was already well past his teens when he wrote mid-1950s manifestoes like “Roll Over Beethoven,” “Rock and Roll Music” and “School Day.” Born Charles Edward Anderson Berry on Oct. 18, 1926, in St. Louis, he grew up in a segregated, middle-class neighborhood there, soaking up gospel, blues, and rhythm and blues, along with some country music.

He spent three years in reform school after a spree of car thefts and armed robbery. He received a degree in hairdressing and cosmetology and worked for a time as a beautician; he married Themetta Suggs in 1948 and started a family. She survives him, as do four children: Ingrid Berry, Melody Eskridge, Aloha Isa Leigh Berry and Charles Berry Jr.

By the early 1950s, he was playing guitar and singing blues, pop standards and an occasional country tune with local combos. Shortly after joining Sir John’s Trio, led by the pianist Johnnie Johnson, he reshaped the group’s music and took it over.

From the Texas guitarist T-Bone Walker, Mr. Berry picked up a technique of bending two strings at once that he would rough up and turn into a rock ’n’ roll talisman, the Chuck Berry lick, which would in turn be emulated by the Rolling Stones and countless others. He also recognized the popularity of country music and added some hillbilly twang to his guitar lines. Mr. Berry’s hybrid music, along with his charisma and showmanship, drew white as well as black listeners to the Cosmopolitan Club in St. Louis.

In 1955, Mr. Berry ventured to Chicago and asked one of his idols, the bluesman Muddy Waters, about making records. Waters directed him to the label he recorded for, Chess Records, where one of the owners, Leonard Chess, heard potential in Mr. Berry’s song “Ida Red.”

A variant of an old country song by the same name, “Ida Red” had a 2/4 backbeat with a hillbilly oompah, while Mr. Berry’s lyrics sketched a car chase, the narrator “motorvatin’” after an elusive girl. Mr. Chess renamed the song “Maybellene,” and in a long session on May 21, 1955, Mr. Chess and the bassist Willie Dixon got the band to punch up the rhythm.

“The big beat, cars and young love,” Mr. Chess outlined. “It was a trend, and we jumped on it.”

The music was bright and clear, a hard-swinging amalgam of country and blues. More than 60 years later, it still sounds reckless and audacious.

Mr. Berry articulated every word, with precise diction and no noticeable accent, leading some listeners and concert promoters, used to a different kind of rhythm-and-blues singer, to initially think that he was white. Teenagers didn’t care; they heard a rocker who was ready to take on the world.

The song was sent to the disc jockey Alan Freed. Mr. Freed and another man, Russ Fratto, were added to the credits as songwriters and got a share of the publishing royalties. Played regularly on Mr. Freed’s show and others, “Maybellene” reached No. 5 on the Billboard pop chart and was a No. 1 R&B hit.

In Mr. Berry’s groundbreaking early songs, his guitar twangs his famous two-stringed lick. It also punches like a horn section and sasses back at his own voice. The drummer eagerly socks the backbeat, and the pianist — usually either Mr. Johnson or Lafayette Leake — hurls fistfuls of tinkling anarchy all around him.

From 1955 to 1958, Mr. Berry knocked out classic after classic. Although he was in his late 20s and early 30s, he came up with high school chronicles and plugs for the newfangled music called rock ’n’ roll.

No matter how calculated songs like “School Day” or “Rock and Roll Music” may have been, they reached the Top 10, caught the early rock ’n’ roll spirit and detailed its mythology. “Johnny B. Goode,” a Top 10 hit in 1958, told the archetypal story of a rocker who could “play the guitar just like ringin’ a bell.”Mr. Berrytoured with rock revues and performed in three movies with Mr. Freed: “Rock, Rock, Rock,” “Mr. Rock and Roll” and “Go, Johnny, Go.” On film and in concert, he dazzled audiences with his duck walk, a guitar-thrusting strut that involved kicking one leg forward and hopping on the other.

Through the 1950s, Mr. Berry had pop hits with his songs about rock ’n’ roll and R&B hits with less teenage-oriented material. He spun surreal tall tales that Bob Dylan and John Lennon would learn from, like “Thirty Days” and “Jo Jo Gunne.” In “Brown Eyed Handsome Man,” from 1956, he offered a barely veiled racial pride. His pithiness and humor rarely failed him.In 1957, Mr. Berry bought 30 acres in Wentzville, where he built a short-lived amusement park, Berry Park, and a restaurant, the Southern Air. In 1958, he opened Club Bandstand in the theater district of St. Louis.

In the early 1960s, Mr. Berry’s songs inspired both California rock and the British Invasion. The Beach Boys reworked his “Sweet Little Sixteen” into “Surfin’ U.S.A.” (Mr. Berry sued them and won a songwriting credit.) The Rolling Stones released a string of Berry songs, including their first single, “Come On,” and the Beatles remade “Roll Over Beethoven” and “Rock and Roll Music.”

But by the time his music started reaching a new audience, Mr. Berry was in jail.

He had been arrested in 1959 and charged with transporting a teenage girl — who briefly worked as a hatcheck girl at Club Bandstand — across state lines for immoral purposes. He was tried twice and found guilty both times; the first verdict was overturned because of racist remarks by the judge. When he emerged from 20 months in prison in 1964, his wife had left him (they later reconciled) and his songwriting spark had diminished.

He had not totally lost his touch, though, as demonstrated by the handful of hits he had in 1964 and 1965, notably “Nadine,” “No Particular Place to Go,” “You Never Can Tell” and “Promised Land.” He appeared in the celebrated all-star 1964 concert film “The TAMI Show,” along with James Brown, the Rolling Stones, Marvin Gaye, the Beach Boys and the Supremes.

While he toured steadily through the 1960s, headlining or sharing bills with bands that grew up on his songs, his recording career stalled after he moved from Chess to Mercury Records in 1966. He remade some of his old hits and tried to reach the new hippie audience, recording “Live at the Fillmore Auditorium” with the Steve Miller Band, billed as the Steve Miller Blues Band at the time. When he returned to Chess in 1970, he recorded new songs, like “Tulane” and “Have Mercy Judge,” that flashed his old wit but failed to reach the Top 40.

In 1972, Mr. Berry had the biggest hit of his career with “My Ding-a-Ling,” a double-entendre novelty song that was included on the album “The London Chuck Berry Sessions” (even though he recorded the song not in London but at a concert in Coventry, England). The New Orleans songwriter Dave Bartholomew wrote and recorded it in 1952; Mr. Berry recorded a similar song, “My Tambourine,” in 1968, and is credited on recordings as the sole songwriter of the 1972 “My Ding-a-Ling.”

It was a million-seller and Mr. Berry’s first and only No. 1 pop single. It was also his last hit. His 1973 follow-up album, “Bio,” was poorly received; “Rockit,” released by Atlantic in 1979, did not sell. But he stayed active: He appeared as himself in a 1979 movie about 1950s rock, “American Hot Wax,” and he continued to tour constantly.

In July 1979, he performed for President Jimmy Carter at the White House. Three days later, he was sentenced to 120 days in federal prison and four years’ probation for income tax evasion.

He had further legal troubles in 1990 when the police raided his home and found 62 grams of marijuana and videotapes from a camera in the women’s room of his restaurant. In a plea bargain, he agreed to a misdemeanor count of marijuana possession, with a suspended jail sentence and two years’ probation.

By the 1980s, Mr. Berry was recognized as a rock pioneer. He never won a Grammy Award in his prime, but the Recording Academy gave him a lifetime achievement award in 1984. He was in the first group of musicians inducted into the Rock and Roll Hall of Fame in 1986.

Around his 60th birthday that year, he allowed the director Taylor Hackford to film him at his home in Wentzville for the documentary “Hail! Hail! Rock ’n’ Roll,” which also included performances by Mr. Berry with a band led by Keith Richards of the Rolling Stones and special guests. “Chuck Berry: The Autobiography” was published in 1988.

Mr. Berry continued performing well into his 80s. He usually played with local pickup bands, as he had done for most of his career, but sometimes he played with fellow rock stars. When the Rock and Roll Hall of Fame and Museum opened in Cleveland in 1995, Mr. Berry performed at an inaugural concert, backed by Bruce Springsteen and the E Street Band.

In 2012, he headlined a Cleveland concert in his honor with a genre-spanning bill that included Darryl McDaniels of Run-D.M.C. and Merle Haggard. Although he told reporters before the show, “My singing days have passed,” he performed “Johnny B. Goode” and “Reelin’ and Rockin’” and joined the other musicians for the closing number, “Rock and Roll Music.”

From 1996 to 2014, Mr. Berry performed once a month at Blueberry Hill, a restaurant in St. Louis where he appeared regularly until Oct. 24.

He made a surprising announcement on his 90th birthday, Oct. 18, 2016: He was planning to release his first studio album in almost 40 years. The album, called simply “Chuck” and scheduled for release in June, was to consist primarily of new compositions.

And Mr. Berry’s music has remained on tour extraterrestrially. “Johnny B. Goode” is on golden records within the Voyager I and II spacecraft, launched in 1977 and awaiting discovery.

Almost got to see Chuck back in late '71 but him and Bill Haley skedaddled out the back door of the venue after local thugs started taking down the stage board by board. Bo Diddley had the sense to grab his hat and go just before said thugs mounted the stage and trashed the instruments. I remember seeing a piano get pushed off the stage and pin a roadie under it while the melee raged, bottles raining down--Chuck's Les Paul Jr. went missing prompting his vow never to return to Vancouver.

It got worse in late spring when the Stones kicked off their Exile tour here and the ensuing riot injured 50 police. Local thugs used molotovs against police, hell one guy had a home-made bazooka that fired railway spikes!

City official responded with a "concert freeze" for the rest of that summer causing local thugs to riot at community events like the Sea Festival or Be-ins. It forced me to ride to Seattle and back in the open box of a pickup to see the make-up show Led Zep played for us frozen out Vangroovy thugs.

TNB doesn't stop with old age or with acquiring wealth. A nigger will always be a nigger.

There were further brushes with the law. In 1988 he settled a lawsuit from a woman he allegedly punched in the face. Two years later he was sued by a group of women after it was discovered that a hidden camera had been placed in the toilets of his restaurant in Missouri. He also received a suspended jail sentence for marijuana possession.

When it came to sex and drugs, rock ‘n’ roll legend Chuck Berry rang all the bells — and then some.

Berry, who died of natural causes on Saturday at age 90, is widely credited with helping create rock ’n’ roll in the 1950s with a string of hits including “Johnny B. Goode” and “Roll Over Beethoven.”

But he would come to set a standard for rock-star depravity that few of his disciples would hope — or even want — to match.

Following two trips to the slammer — first at the height of his fame in the early 1960s for transporting a 14-year-old girl across state lines for sex, and again in 1979 for tax evasion — Berry was busted over a 1990 drug raid on his estate in Wentzville, Mo.

Although authorities suspected him of transporting huge loads of cocaine in his guitar case as part of a multimillion-dollar drug operation, the search only turned up about two ounces of pot, some hashish, two rifles and a shotgun, as well as more than $122,000 in cash.

But the cops also found a huge stash of pornography, including dozens of videotapes, trays of photographic slides and books — some of which appeared to show underage girls.

Berry, who publicly denied ever using coke, was charged with pot possession and three counts of child abuse for the underage porn.

He sued the county prosecutor, William J. Hannah, accusing him of filing malicious and politically motivated charges, and later cut a no-jail plea deal in which the child-abuse charges were dismissed and he dropped his civil case.

The seizure of Berry’s porn collection, however, led to a scandalous 1993 report in the since-defunct Spy magazine that went way beyond the earlier scandals — revealing a penchant for sexual fetishes involving bodily excretions and a predilection for spying on women in bathrooms.

The magazine described a homemade video in which Berry and “an attractive blond white woman” both relieved themselves during a New Year’s Eve romp in the bathroom of a hotel suite in Lake Tahoe, Nev.

The report also detailed how Berry allegedly installed hidden cameras in the women’s restroom at the Southern Air restaurant in Wentzville after he bought it in 1987. One camera “was evidently behind the toilet seat,” according to Spy, while others captured “aerial views of the toilets’ contents during the seconds after the women stood but before they flushed.”

The recordings were then reportedly “painstakingly” edited and compiled in a pair of “toilet tapes” that showed hundreds of women and girls “in the act of relieving themselves.” “Sometimes the frame is frozen for a few seconds, lingering on moments that must have been considered particularly moving,” Spy reported.

In 1994, Berry settled for $830,000 a class-action suit filed by dozens of women who claimed they had been taped using the bathroom, and also settled a similar suit filed by a former restaurant worker and another woman for $310,000.

Berry was also publicly shamed when the High Society nudie magazine in January 1990 published photos of him posing naked with different women, with the publication claiming to be “the only magazine with the balls to show Chuck’s berries.”

The “School Days” singer’s first brush with the law came as a youth, when he was sent to reformatory for three years for pulling off an armed carjacking with a pair of buddies.

After getting sprung, he got a cosmetology degree and worked as a beautician, and in 1948 married Themetta “Toddy” Suggs, with whom he had four kids.

His music career began in the early 1950s. Berry scored his first hit in 1955 with “Maybellene.”

But by 1959, he was in trouble again, busted over a racially charged incident at a dance at the Meridian, Miss., high school.

According to Berry’s autobiography, “one of the girls threw her arms around me and hung a soul-searching kiss that I let hang a second too long.”

Someone shouted out that “this n—-r asked my sister for a date!” and a mob chased him outside, where the cops caught him hiding in a nearby building.

Berry was charged with disturbing the peace — which he settled by spending a night in jail and surrendering the $700 seized from his pockets.

That incident paled in comparison, however, with the case brought later that year, when he was charged with violating the federal Mann Act — also known as the White Slave Traffic Act — which prohibits transporting women across state lines for “prostitution or debauchery, or for any other immoral purpose.”

The victim in question was a 14-year-old waitress and prostitute whom Berry picked up while traveling in Mexico and brought back to St. Louis to work as a hostess at his Club Bandstand nightclub.

Berry — who later claimed the girl told him she was 21 — fired her after several weeks, after which she was busted for prostitution and told the cops that Berry repeatedly had sex with her while they were on the road, including in the back of his Cadillac.

Berry was convicted by an all-white jury and sentenced to the maximum five years in the slammer by Judge George Moore, who told him “I have seen your kind before” and denied him bail pending appeal.

“I would not turn this man loose to go out and prey on a lot of ignorant Indian girls and colored girls, and white girls, if any,” he added.

The conviction was overturned based on racist remarks made by the judge, but a second jury also convicted Berry and he wound up serving 20 months behind bars, during which time he wrote several songs.

Chuck Berry performs on stage in Crocus City Hall on April 14, 2014, in Moscow, Russia.
Getty Images

The lyrics to one of them, the 1975 folk track “Promised Land,” recount a cross-country trip from Norfolk, Va., to Los Angeles — even though Berry said prison officials “were not so generous as to offer a map of any kind, for fear of providing the route for an escape.”

Berry ran afoul of the law again in 1979, when he was slapped with tax charges and quickly struck a plea deal in which he admitted cheating the feds out of $110,000 in income taxes.

He twice broke into tears during his sentencing, at which the judge slapped him with 120 days behind bars and four years’ probation.

The court session came little more than a month after Berry had entertained then-President Jimmy Carter and his family on the lawn of the White House.

Years later, Berry admitted the tax case “was no bum rap” — but claimed that the government had inflated its losses.

“It was straight, true. It was a bum rap in the sense that . . . it was about 15 percent that they added, but that’s nothing to kick about,” he told Goldmine magazine. “In other words, they were about 85 percent right and 15 percent wrong.”

Berry long cultivated a reputation as a cheapskate, in large part because he used local “pick-up” bands while on tour instead of hiring regular performers, often resulting in sloppy performances with the musicians he met just moments before hitting the stage.

In 1987 — a year after his induction into the Rock & Roll Hall of Fame — he even admitted that he became a rock ‘n’ roller for the money, and that “the Big Band era is my era.”

“Rock ‘n’ roll accepted me and paid me, even though I loved the big bands,” he told the Los Angeles Times.

“I went that way because I wanted a home of my own,” he said. “I had a family. I had to raise them. Don’t leave out the economics. No way.”

Later that year, Berry was accused of punching a woman in the mouth during an early morning dispute at the Gramercy Park Hotel.

Friends described victim Marilyn O’Brien Boteler as a 30-something rock singer who dated Berry — whom she slapped with a $5 million suit that claimed she needed five stitches as result of the smack.

Berry was also charged with assault but failed to appear in court in June 1988, leading to a bench warrant for his arrest.

He later plea-bargained to a lesser charge of harassment and was sentenced to a $250 fine.

Author Bruce Pegg, who wrote a 2002 biography titled “Brown Eyed Handsome Man: The Life and Times of Chuck Berry,” described the musician as a complicated man.

While Pegg said he believed the Mann Act conviction “was racist in nature” and the videotape scandal “began with a personal grudge,” he also said Berry was no saint and someone who “kept on giving everyone a 2-by-4 big enough to him with.

“Yet at the same time, those who knew him well told me about what a wonderful family man he was,” Pegg added.