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. He was 90.

The St. Charles County Police Department in Missouri confirmed his death on its Facebook page. Mr. Berry died at his home near Wentzville, Mo., about 45 miles west of St. Louis. The department said it responded to a medical emergency and he was declared dead after 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.

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.