Buñuel was born in Calanda, a small town in the province of Teruel, in the Aragon region of Spain, to Leonardo Buñuel, the cultivated scion of an established Aragonese family, and María Portolés, many years younger than her husband, with wealth and family connections of her own.:pp.16–17 He would later describe his birthplace by saying that in Calanda, "the Middle Ages lasted until World War I". The oldest of seven children, Luis had two brothers, Alfonso and Leonardo, and four sisters: Alicia, Concepción, Margarita and María.
When Buñuel was four and a half months old, the family moved to Zaragoza, where they were one of the wealthiest families in town.:p.22 In Zaragoza, Buñuel received a strict Jesuit education at the private Colegio del Salvador.:pp.23–36 After being kicked and insulted by the study hall proctor before a final exam, Buñuel refused to return to the school. He told his mother he had been expelled, which was not true; in fact, he had received the highest marks on his world history exam. Buñuel finished the last two years of his high school education at the local public school. Even as a child, Buñuel was something of a cinematic showman; friends from that period described productions in which Buñuel would project shadows on a screen using a magic lantern and a bedsheet. He also excelled at boxing and playing the violin.
In his youth, Buñuel was deeply religious, serving at Mass and taking Communion every day, until, at the age of 16, he grew disgusted with what he perceived as the illogicality of the Church, along with its power and wealth.:p.292
In 1917, he attended the University of Madrid, first studying agronomy then industrial engineering and finally switching to philosophy. He developed a very close relationship with painter Salvador Dalí and poet Federico García Lorca, among other important Spanish creative artists living in the Residencia de Estudiantes, with the three friends forming the nucleus of the Spanish Surrealist avant-garde, and becoming known as members of "La Generación del 27". Buñuel was especially taken with Lorca, later writing in his autobiography: "We liked each other instantly. Although we seemed to have little in common—I was a redneck from Aragon, and he an elegant Andalusian—we spent most of our time together... We used to sit on the grass in the evenings behind the Residencia (at that time, there were vast open spaces reaching to the horizon), and he would read me his poems. He read slowly and beautifully, and through him I began to discover a wholly new world.":p.62 Buñuel's relationship with Dalí was somewhat more troubled, being tinged with jealousy over the growing intimacy between Dalí and Lorca and resentment over Dalí's early success as an artist.:p.300
Since he was 17, he steadily dated the future poet and dramatist Concha Méndez, with whom he vacationed every summer at San Sebastián. He introduced her to his friends at the Residencia as his fiancée. After five years, she broke off the relationship, citing Buñuel's "insufferable character".
During his student years, Buñuel became an accomplished hypnotist. He claimed that once, while calming a hysterical prostitute through hypnotic suggestion, he inadvertently put one of the several bystanders into a trance as well.:p.67 He was often to insist that watching movies was a form of hypnosis: "This kind of cinematographic hypnosis is no doubt due to the darkness of the theatre and to the rapidly changing scenes, lights, and camera movements, which weaken the spectator's critical intelligence and exercise over him a kind of fascination.":p.69
Buñuel's interest in films was intensified by a viewing of Fritz Lang's Der müde Tod: "I came out of the Vieux Colombier [theater] completely transformed. Images could and did become for me the true means of expression. I decided to devote myself to the cinema". At age 72, Buñuel had not lost his enthusiasm for this film, asking the octogenarian Lang for his autograph.:p.301