AMC

In most cases, “Mad Men” is bound by the history of the era in which it takes place. But on Sunday night, a new episode of that 1960s period drama that concluded with the Beatles song “Tomorrow Never Knows” appears to have made some history of its own, marking a rare instance in which a song written and recorded by that band has been licensed for use on a television series.

“It was always my feeling that the show lacked a certain authenticity because we never could have an actual master recording of the Beatles performing,” Matthew Weiner, the creator and show runner of “Mad Men,” said in a telephone interview on Monday. “Not just someone singing their song or a version of their song, but them, doing a song in the show. It always felt to me like a flaw. Because they are the band, probably, of the 20th century.”

As with most transactions that involve the Beatles, that usage did not come cheap. According to two people briefed on the deal, who were not authorized to speak publicly about it, Lionsgate, the studio that produces “Mad Men,” paid about $250,000 for the recording and publishing rights to the song. That is an appropriately high price, several music and advertising executives say, since many major pop songs can be licensed for less than $100,000.

Mr. Weiner declined to discuss the licensing costs, but said: “Whatever people think, this is not about money. It never is. They are concerned about their legacy and their artistic impact.”

Covers of Beatles songs turn up in various media, but the band’s own recordings are rarely heard on television or in films. The surviving Beatles and their heirs are known to be very picky licensors, turning down almost every request.

Aside from songs that have been played in the occasional commercial or the Beatles cartoon series that was shown on ABC in the 1960s, the use of “Tomorrow Never Knows” on “Mad Men” is probably one of the only times that a Beatles track has been used in a TV show, music and advertising executives say.

Jeff Jones, the head of Apple Corps, the Beatles’ company, wrote in an e-mail on Monday that it was the first such license in the five years he has been with the group, although he said he could not be sure about earlier uses that predate his time at the company. Mr. Weiner said he was told that it was the only time a Beatles song has been in a television show, other than the band’s live performances.

Near the end of the “Mad Men” episode, titled “Lady Lazarus” and written by Mr. Weiner, the advertising executive Don Draper (played by Jon Hamm) finds himself struggling to understand youth culture and is given a copy of the Beatles album “Revolver,” a new release in the summer of 1966.

But instead of starting his listening experience with the album’s acerbic lead-off track, “Taxman,” Draper instead skips to its final — and, shall we say, more experimental — song, “Tomorrow Never Knows,” contemplating it for a few puzzled moments before he shuts it off. (That psychedelic song, with its signature percussion loops and distorted John Lennon vocals, also plays over the closing credits of the episode.)

Mr. Weiner said he had been trying “for a few years” to get different Beatles songs onto “Mad Men,” but had been rejected by Apple Corps in the past.

To win the company’s approval in this case, Mr. Weiner said, “I had to do a couple things that I don’t like doing, which is share my story line and share my pages.” He added that he received the approval from Apple Corps last fall, about a month before filming started on the episode.

“It was hard,” Mr. Weiner said, “because I had to, writing-wise, commit to the story that I thought was worthy of this incredible opportunity. The thing about that song in particular was, the Beatles are, throughout their intense existence, constantly pushing the envelope, and I really wanted to show how far ahead of the culture they were. That song to me is revolutionary, as is that album.” (Asked what he would have done if Apple Corps had once again said no, Mr. Weiner replied: “I don’t know. I would have changed the story.”)

Though “Lady Lazarus” has its own story line about the difficulty — if not impossibility — of getting the Beatles to license their songs for television, Mr. Weiner said the use of “Tomorrow Never Knows” was not meant to be self-referential or self-congratulatory.

“Even people who are not in the clearances and rights business were struck by the fact that that was actually the Beatles,” he said. “You just get the satisfaction of knowing that was not an imitation and it’s that recording.”

(Another bit of Beatles trivia referenced in the episode: “September in the Rain,” the Wedgewoods track that Draper and his colleagues contemplate as a substitute for an authentic Fab Four tune, is one of 15 songs the Beatles performed at a 1962 audition for Decca Records. That label turned them down, the Beatles signed with Parlophone, and the rest is twisting, shouting, walrus-identifying history.)

Despite the assumption of some audience members that “Mad Men” had broken its music-licensing budget for the season on this one song, Mr. Weiner said this was not the case.

“You cannot buy your way into these things,” he said. “In my heart, I operate in a realistic world because I’m producing a TV show. I never, ever think about that — ‘Oh, let’s not have a song here so I can save some money.'”

Mr. Weiner pointed to another “Mad Men” episode from earlier this season, in which a Beach Boys song is played during a character’s LSD trip. “No one ever asked, ‘What does it cost to have that song?’ ” he said. “You think that that’s free?”