By contrast with his songwriter partner Burt Bacharach, whose suavely youthful looks belonged in a 1960s Martini ad, the lyricist Hal David, who has died at the age of 91, resembled a president of a suburban Rotary Club: a conservative, suit-and-tie figure from an earlier generation, modest and unassuming in conversation. But it was David's words as much as Bacharach's melodies that captured an audience for such songs as Anyone Who Had a Heart, I Say a Little Prayer, Walk on By, (There's) Always Something There to Remind Me, Alfie, Trains and Boats and Planes, (They Long to Be) Close to You, Raindrops Keep Fallin' on My Head and Do You Know the Way to San Jose?
Their period of greatest productivity, between 1962 and 1968, coincided with the heyday of their partnership with Dionne Warwick, the gospel-trained singer who gave voice to their finest collaborations. In her they found the perfect vehicle not just for Bacharach's adventures with melody, harmony and metre but also for the directness, emotional honesty and fidelity to vernacular speech with which David exalted what might in other hands have remained Mills and Boon cliches.
His empathy with female listeners was particularly evident. "The moment I wake up / Before I put on my make-up / I say a little prayer for you" would be one celebrated example. In Wives and Lovers he catches, without irony, the evolutionary moment just before – to borrow a couple of characters from Mad Men – the husband-chasing secretary Joan Holloway gave way to the independence-seeking copywriter Peggy Olsen: "Day after day there are girls at the office / And men will always be men / Don't send him off with your hair up in curlers / You may not see him again ..."
But David, like his partner, was also a craftsman of great subtlety. Anyone Who Had a Heart, their second hit with Warwick, barely deviates from a single note for its opening lines, focusing attention on the poignant plea of the lyric as Warwick glides over the uneven bar-lengths. Do You Know the Way to San Jose? has verses that uncoil and tighten as David negotiates Bacharach's deceptively jaunty syncopations: "LA is a great big freeway / Put a hundred down and buy a car / In a week, maybe two, they'll make you a star / Weeks turn into years / How quick they pass / And all the stars that never were are parking cars and pumping gas."
David took a while to discover his vocation as an heir to the great Broadway lyricists. He was born in Manhattan, New York, the son of Austrian-Jewish immigrants. His older brother Mack was the first to enjoy success as a songwriter, with I'm Just a Lucky So-and-So. Hal worked as a copywriter for the New York Post and it was not until he emerged from wartime service in the army that he decided to follow Mack's lead.
Before working with Bacharach, his short list of successes included Broken-Hearted Melody, a hit for Sarah Vaughan. In 1957 they wrote The Story of My Life for Marty Robbins, followed a year later by Magic Moments, a worldwide smash for Perry Como, leading Bacharach to shed his other collaborators.
Warwick was not the only recipient of their classics: they provided 24 Hours from Tulsa for Gene Pitney, The Look of Love for Dusty Springfield, Make It Easy on Yourself for Jerry Butler, What's New, Pussycat? for Tom Jones, and The Last One to Be Loved and Message to Martha (Kentucky Bluebird) for Lou Johnson, a polished and versatile soul singer who might, with better luck, have become the male equivalent of Warwick. Their songs have been covered by countless artists, but Aretha Franklin's 1968 reading of I Say a Little Prayer represents a rare instance of an improvement on Warwick's original.
Bacharach and David created the successful musical Promises, Promises in 1968; two years later they received an Oscar for Raindrops Keep Fallin' on My Head, from Butch Cassidy and the Sundance Kid. But it was the failure of the film Lost Horizon (1973), a musical version of the prewar Frank Capra movie, that presaged the break-up of their partnership. Amid a tangle of lawsuits – with Warwick suing them both for failing to provide her with new material – they did not work together again for 20 years. Bacharach used other lyricists, while David withdrew from the fray, emerging to collaborate with Albert Hammond on To All the Girls I've Loved Before for Willie Nelson and Julio Iglesias in 1984.
He served for many years as the president of ASCAP, the songwriters' royalty-collection agency. His first wife, Anne, died in 1987. He is survived by their two sons and by Eunice, his second wife.
• Hal (Harold Lane) David, lyricist, born 25 May 1921; died 1 September 2012