LOS ANGELES — Hal David, the stylish, heartfelt lyricist who teamed with Burt Bacharach on dozens of timeless songs for movies, television and a variety of recording artists in the 1960s and beyond, has died at age 91.

David died of complications from a stroke Saturday morning at Cedars-Sinai Medical Center in Los Angeles, according to his wife, Eunice David.

He had suffered a major stroke in March and was stricken again on Tuesday, she said.

“Even at the end, Hal always had a song in his head,” Eunice David said. “He was always writing notes, or asking me to take a note down, so he wouldn’t forget a lyric.”

Bacharach and David were among the most successful teams in modern history, with top 40 hits including “Raindrops Keep Fallin’ On My Head,” “Close to You” and “That’s What Friends Are For.”

Although most associated with Dionne Warwick, their music was recorded by the top acts of their time, from the Beatles and Barbra Streisand to Frank Sinatra and Aretha Franklin.

They won an Oscar for “Raindrops Keep Fallin’ on My Head” (from the movie “Butch Cassidy and the Sundance Kid”), Grammys and Tonys for the songs from the hit Broadway musical “Promises, Promises.”

“As a lyric writer, Hal was simple, concise and poetic — conveying volumes of meaning in fewest possible words and always in service to the music,” songwriter Paul Williams, president of the American Society of Composers, Authors and Publishers, said. “It is no wonder that so many of his lyrics have become part of our everyday vocabulary and his songs … the backdrop of our lives.”

In May, Bacharach and David received the Library of Congress Gershwin Prize for Popular Song during a White House tribute concert attended by President Obama.

Bacharach, 83, thanked Obama, saying the award for his life’s work topped even the Oscars and Grammys he won for individual projects. David could not attend because he was recovering from a stroke.

David and Bacharach met when both worked in the Brill Building, New York’s legendary Tin Pan Alley song factory where writers cranked out songs and attempted to sell them to music publishers. They scored their first big hit with “Magic Moments,” a million-selling record for Perry Como.

In 1962 they began writing for a young singer named Dionne Warwick, whose versatile voice conveyed the emotion of David’s lyrics and easily handled the changing patterns of Bacharach’s melodies.

Together the trio created a succession of popular songs including “Don’t Make Me Over,” “Walk On By,” “I Say a Little Prayer,” “Do You Know the Way to San Jose,” “Trains and Boats and Planes,” “Anyone Who Has a Heart,” “You’ll Never Get to Heaven” and “Always Something There to Remind Me.”

Bacharach and David also wrote hits for numerous other singers: “This Guy’s in Love with You” (trumpeter Herb Alpert in his vocal debut), “Make It Easy on Yourself” (Jerry Butler), “What the World Needs Now Is Love” (Jackie DeShannon) and “Wishin’ and Hopin”‘ (Dusty Springfield).

They also turned out title songs for the movies “What’s New, Pussycat” (Tom Jones), “Wives and Lovers” (Jack Jones) and “The Man Who Shot Liberty Valence” (Gene Pitney).

In a 1999 interview, David explained his success as a lyricist: “Try and tell a narrative. The songs should be like a little film, told in three or four minutes. Try to say things as simply as possible, which is probably the most difficult thing to do.”