In the fall of 1966, John Lennon took a break from the Beatles and went to southern Spain, where he acted in Richard Lester’s black comedy “How I Won the War” and wrote the first draft of “Strawberry Fields Forever.”

From that little-known chapter of Lennon’s life, the Spanish director and screenwriter David Trueba has extracted “Living Is Easy With Eyes Closed,” the Spanish entry in the competition for the Oscar for best foreign-language film.

Photo

The main character in “Living Is Easy,” a mixture of comedy and drama that won six Goyas, Spain’s equivalent of the Oscar, is Antonio, a shy schoolteacher who is such a fan of the Beatles that he uses their lyrics to teach English to his students. Hearing that Lennon is in Spain, he decides to drive to the film set to meet his hero, and along the way picks up a pair of hitchhikers: a pregnant teenager on the lam from a home for wayward girls and a sensitive boy fleeing his overly strict father.

Antonio is based on a real person, a teacher named Juan Carrión, who actually met Lennon and still has the notebooks in which Lennon corrected Mr. Carrión’s transcriptions of lyrics from Beatles albums. He complained to Lennon that the Beatles did not print their lyrics on the jackets of their albums, and whether by coincidence or not, “Sgt. Pepper’s Lonely Hearts Club Band” and other later records did come with lyric sheets.

“His trip was almost exactly as related in the film, though neither he nor Richard Lester knew that John Lennon had written ‘Strawberry Fields Forever’ while he was in Almeria,” said Mr. Trueba, 45. “Lennon never gave him the lyrics, but it was fun to see the notebooks and the letters that he later sent Juan from London, because you get a sense of John Lennon’s great sense of humor.”

A former journalism student, Mr. Trueba studied for a year at the American Film Institute in Los Angeles before embarking on a career as a writer and director for television and, eventually, film. He is also a novelist, occasionally an actor and, obviously, a fan of the Beatles. He spoke recently by telephone from Madrid about the pleasures and difficulties of making the film. Here are excerpts:

Q.

Even for Beatles fans, this is a rather obscure episode. How did you learn about it?

A.

On vacation in Almeria in 2006, I saw a newspaper article about the 40th anniversary of John Lennon being there, and it related anecdotes from the shooting of “How I Won the War.” One of them was about a schoolteacher from that era, now elderly, who had used the lyrics from “Revolver,” then the most recent Beatles album, to teach English. It turned out that there had been a meeting between the two of them. So I mixed that with a story from my own family, about one of my older brothers who left home because he wanted to have long hair and my father wouldn’t let him.

Q.

The story takes place in a period immediately before your birth. What made the Spain of that era so interesting to you?

A.

I wanted to tell a story about the nonpolitical revolution that took place under Franco in the 1960s. I have the feeling that what changes a society are ordinary people. So it appealed to me to talk about this kind of change going on [nearly] 10 years before Franco’s death, with the Beatles, rock in general and the arrival of foreign tourism in Spain. I wanted to show how countries can also change from the bottom up, and not just as the history books say, from the top down.

Q.

Another of the elements that make up this story is clearly that of the road movie, no?

A.

Yes. For me the movie is one part road movie, and another part adventure. But I always say that the best road movie I’ve ever read in my life is Don Quixote. That’s the origin of all of them, and I was very interested in how the characters used this trip to mend themselves, to tell how this almost impossible encounter of three people affects each one in the group.

Q.

It took quite a while to write the screenplay and put the movie together. How come?

A.

In Spain it always takes a while to get the financing for those of us who are the screenwriters of our own films that we direct. It took seven years in all. Look, this is a movie that in the beginning a lot of people in Spain didn’t think was sufficiently commercial. Yes, I wanted to make it, this was my undertaking, and that’s sometimes difficult. The easy thing to do is what others want you to do.

Q.

We never see John Lennon in this film. I imagine you thought a lot about that, whether to have an actor play John Lennon or not.

A.

When I said a lot of people didn’t consider the film commercial, there were a lot of them who said it would be commercial if the main character were John Lennon. But I have to confess I don’t like very much the biopics where you have actors imitating famous people. You always stay on a very superficial level, whereas with a fictional character you can sound out the depth you want and include in that character elements of others. So it was from the beginning a creative decision that I had to take. I always wanted the spectator to have this distant vision of him.

Q.

When you find an interesting story, how do you decide which will be a novel and which a film?

A.

It’s very curious, because in my case, at the moment that a story or an idea emerges, it already comes defined as something literary or cinemagraphic. Let me give you an example: when I came across this story about the teacher in the newspaper, the first thing I thought was, “He’s a beautiful character for a movie.” I didn’t think “Oh look, here’s a character who might be good for a novel.” It’s as if an idea comes to me hand in hand with the format in which I should tell it.

Q.

Let’s talk about the Oscar. What’s your evaluation of the process?

A.

I don’t know much about it. Here in Spain we are going through economic difficulties; we don’t have the resources to do a really professional campaign. So I’m really humble about this. But you always think in the end that film is film, and if the voters are cinema professionals, you’ve got a chance.

Q.

Your older brother Fernando won an Oscar, for “Belle Epoque” in 1993. Has he given you any advice?

A.

[Laughs] No, not really. The only thing he told me was, “Look, up until the moment when they announce the short list, it’s best not to do too much. Because that can be misinterpreted, as a kind of pressure on the voter.” We talked one day, and he said, “I think it’s best that you let the picture be seen.” Fernando is an optimist by nature, so he said, “I’m sure that if Academy members get to see it, they are certain to nominate it. You just need to remain calm and do things at their proper moment.”