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. The department said it responded to a medical emergency at a home and Mr. Berry 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,” “Maybellene” and “Roll Over Beethoven,” he gave his listeners more than they knew they were getting from jukebox entertainment.

Chuck Berry (photo via nytimes.com)

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,” “Rock n Roll Music” and other songs, Mr. Berry invented rock as a music of teenage wishes fulfilled and good times. (The Beach Boys reworked his “Sweet Little Sixteen” into “Surfin’ U.S.A.” Mr. Berry sued them and won a songwriting credit.)

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.