Bill Backer, a lapsed lyricist whose classic 1971 commercial taught a fractious world of potential Coca-Cola consumers to sing in perfect harmony and was featured in the finale of “Mad Men,” died Friday in Warrenton, Virginia. He was 89.

His death was confirmed by his wife and only immediate survivor, the former Ann Mudge.

Backer and his team immortalized jingles and slogans that proclaimed “Things go better with Coke” and defined the soft drink as “the real thing”; declared that Miller Lite was “everything you ever wanted in a beer... and less”; elevated the Campbell’s brand by asserting that “soup is good food”; and allowed that “little girls have pretty curls, but I like Oreo.”

He also anointed the break devoted to beer drinking as “Miller Time,” reserved festive occasions for Lowenbrau (“Here’s to good friends, tonight is kind of special”), and created advertising campaigns for Fisher-Price, Hyundai cars, Parliament cigarettes, Philip Morris, Quaker Foods and Xerox.

But Backer had no illusions about what collaboration he would be remembered for, as he told The New York Times in 1993 when he was about to retire as vice chairman and worldwide creative director of Backer Spielvogel Bates after a four-decade career in advertising.

“Nobody out there has heard of J. Walter Thompson or Backer Spielvogel Bates,” he said. “Those are temporal, self-aggrandizing entities. But if you come up with what’s basically a little hymn to getting the world together, it’s a contribution.”

His little hymn, “I’d Like to Teach the World to Sing (in Perfect Harmony),” became a memorable commercial for Coca-Cola, a hit record, the inspiration for a sequel Super Bowl advertisement in 1991 and a coda for “Mad Men” on AMC last year, when Don Draper, the series’ protagonist, meditating at a spiritual retreat in California, conjured up the original 1971 utopian vision of apple trees and honeybees and snow white turtledoves, which prompted a youthful multicultural chorus on an Italian hilltop to want “to buy the world a Coke and keep it company.”

Matthew Weiner, the creator of “Mad Men,” was quoted as describing the series finale as “a love letter for a brand.”

Backer’s own epiphany behind what became known as the hilltop commercial was not quite as blissful.

According to his account in a company-sponsored video, he was on his way to London in January 1971 to meet with the songwriters Billy Davis and Roger Cook when his flight was diverted by fog to Shannon Airport in Ireland.

The next morning, Backer was stunned to see the diverse group of passengers who had been angry the night before cheerfully conversing in the coffee shop.

“People from all over the world, forced by circumstance, were having a Coke — or a cup of coffee or tea — together,” he wrote in his 1993 book, “The Care and Feeding of Ideas.” “They were making eye contact over a Coke, and they were keeping each other company.”

“That was the basic idea,” he wrote:

“to see Coke not as it was originally designed to be — a liquid refresher — but as a tiny bit of commonality between all peoples.”

By the time he flew to Liverpool and was bused to fog-shrouded London, he recalled: “I could see and hear a song that treated the whole world as if it were a person — a person the singer would like to help and get to know. I’m not sure how the lyric should start, but I know the last line.”

On a paper napkin, he had scribbled, “I’d like to buy the world a Coke and keep it company.”

The three songwriters concurred on the lyrics, and the vocal group the New Seekers recorded it for radio (adapting the tune from a song by Cook and Roger Greenaway).

Coca-Cola’s president deemed it too sappy. Coke bottlers hated it. So Backer persuaded the company to try a video version instead. Harvey Gabor, a young art director, envisioned a diverse chorus in native garb lip-syncing. A near-record $250,000 was approved for production.

A cast was rehearsed at the white cliffs of Dover, but after a three-day downpour, production was shifted to a hillside outside Rome. At first, hundreds of impatient and parched schoolchildren unharmoniously stampeded to grab free bottles of soda. A new cast was finally recruited, the commercial became a success, and recordings by both the New Seekers and the Hillside Singers (with the reference to Coke removed) hit the Billboard charts.

The commercial succeeded, Backer told Slate in 2014, because “it’s not phony. The product itself is a product that brings people together. It was a simple observation of the product performing one of the functions it does so well: It’s a social catalyst.”

William Montague Backer was born in New York on June 9, 1926, to William Bryant Backer, a real estate developer, and the former Ferdinanda Legare. His father died when he was 6, and he moved with his mother to her native South Carolina.

He wrote musical comedies in high school, served in the Navy and graduated from Yale in 1950. He hoped to become a songwriter but was persuaded by his mother and stepfather, Dr. Joseph I. Waring, to go into a more legitimate business, like real estate, which he did briefly.

He then started a jingle business before leaving for Columbia Pictures, but was so critical of the commercials being produced there that he was fired. His boss suggested an ad agency.

In 1953, he went to work in the mailroom at McCann Erickson. He was named creative director in 1972 and vice chairman in 1978. A year later, he and Carl Spielvogel, a former advertising columnist for The Times and an executive at McCann’s owner, Interpublic, formed their own agency.

By 1984, Backer & Spielvogel was billing more than $400 million a year. In 1986 it was bought by the British company Saatchi & Saatchi for a reported down payment of $56 million, with $45 million more paid over six years, and merged with Ted Bates Worldwide.

After Backer retired, he moved to Virginia, where he owned a thoroughbred horse farm and was president of the Piedmont Foundation, which supports land conservation.