DLKW beat DDB London in a final shoot-out, but saw off competition from J. Walter Thompson, Clemmow Hornby Inge, Euro RSCG London and WCRS at an early stage of the three-month pitch process.
The incumbent agency, Abbott Mead Vickers BBDO, was not involved in the pitch.
But DLKW's future with WH Smith is far from certain. Permira, the private equity company, has presented WH Smith with a 375p a share offer, valuing the company at £940 million. Bids are expected from other venture capitalists.
Reports of the possible takeover came just days before WH Smith revealed a poor set of interim results, with profits affected by declining high-street trade.
Greg Delaney, the DLKW chairman, said: "Whatever happens, WH Smith will need advertising and marketing and, having gone through a hugely thorough selection process, I would hope that we are in a good position to help it with its needs."
DLKW will work with WH Smith's newly appointed media agency, Carat, which won the planning and buying account from Starcom Motive earlier this month.
Stephen Robertson, the interim marketing director, said: "We are delighted to be able to appoint DLKW, following an impressive pitch process in which both finalists presented strong creative ideas. Our final decision was based on a combination of the excellent standard of strategy and ideas as well as a cultural fit with the team at WH Smith, which we felt was vital to ensure the delivery of a successful advertising campaign in the future."
Delaney added: "We are delighted to be working with a British high-street icon such as WH Smith."