And so they had another smash: “What the World Needs Now is Love.”
Mr. David and Mr. Bacharach met when both worked in the Brill Building, New York’s legendary Tin Pan Alley song factory where writers cranked out songs to sell to music publishers. They scored their first big hit with “Magic Moments,” a million-selling record for Perry Como.
Their success transferred to film and theater, where they won an Oscar for “Raindrops Keep Fallin’ on My Head” (from the movie “Butch Cassidy and the Sundance Kid”), and Grammys and Tonys for the songs from the hit Broadway musical “Promises, Promises.”
But the hit-making team broke up after the 1973 musical remake of “Lost Horizon.” The pair and Miss Warwick had devoted two years to the movie, which was scorned by critics and audiences. Mr. Bacharach then sequestered himself in his vacation home and refused to work.
Mr. Bacharach and Mr. David sued each other, and Miss Warwick sued them both. The cases were settled out of court in 1979 and the three went their separate ways. They reconciled in 1992 for Miss Warwick’s recording of “Sunny Weather Lover.”
Mr. David went on to collaborate successfully with other composers: John Barry with the title song of the James Bond film “Moonraker;” Albert Hammond with “To All the Girls I’ve Loved Before,” which Julio Iglesias and Willie Nelson sang as a duet; and Henry Mancini with “The Greatest Gift” in “The Return of the Pink Panther.”
Mr. David joined the board of the American Society of Composers, Authors and Publishers in 1974 and served as president from 1980 to 1986. He was head of the Songwriters Hall of Fame from 2001 to 2011 and was chairman emeritus at his death.
“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,” ASCAP’s president, the songwriter Paul Williams, said in a statement. “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, Mr. Bacharach and Mr. David received the Library of Congress’ Gershwin Prize for Popular Song during a White House tribute concert attended by President Obama. Mr. David, recovering from a major stroke in March, did not attend, but his wife accepted on his behalf.
“It was thrilling,” she said. “Even though he wasn’t there, Hal said it was the highest honor he had ever received.”
Mr. Obama noted their music is still being recorded by such artists as Alicia Keys and John Legend.
“Above all, they stayed true to themselves,” Mr. Obama said. “And with an unmistakable authenticity, they captured the emotions of our daily lives — the good times, the bad times, and everything in between.”
Born in New York, David attended public schools and NYU, then served in the Army during World War II, mostly as a member of an entertainment unit in the South Pacific. After the war, he was a copywriter at the New York Post and wrote lyrics for bandleaders before hooking up with Mr. Bacharach.
He married Anne Rauchman in 1947, and together they had two sons.
Singer Smokey Robinson called on others to honor Mr. David’s musical legacy.