At the Residencia de Estudiantes in Madrid, García Lorca befriended Luis Buñuel and Salvador Dalí and many other creative artists who were, or would become, influential across Spain. He was taken under the wing of the poet Juan Ramón Jiménez, becoming close to playwright Eduardo Marquina and Gregorio Martínez Sierra, the Director of Madrid’s Teatro Eslava.

In 1919–20, at Sierra’s invitation, he wrote and staged his first play, The Butterfly’s Evil Spell. It was a verse play dramatising the impossible love between a cockroach and a butterfly, with a supporting cast of other insects; it was laughed off the stage by an unappreciative public after only four performances and influenced García Lorca’s attitude to the theatre-going public for the rest of his career. He would later claim that Mariana Pineda, written in 1927, was, in fact, his first play. During the time at the Residencia de Estudiantes, he pursued degrees in law and philosophy, though he had more interest in writing than study.

García Lorca’s first book of poems, Libro de poemas, was published in 1921, collecting work written from 1918 and selected with the help of his brother Francisco (nicknamed Paquito). They concern the themes of religious faith, isolation, and nature that had filled his prose reflections. Early in 1922 at Granada García Lorca joined the composer Manuel de Falla in order to promote the Concurso de Cante Jondo, a festival dedicated to enhance flamenco performance. The year before Lorca had begun to write his Poema del cante jondo (“Poem of the Deep Song,” not published until 1931), so he naturally composed an essay on the art of flamenco, and began to speak publicly in support of the Concurso. At the music festival in June he met the celebrated Manuel Torre, a flamenco cantaor. The next year in Granada he also collaborated with Falla and others on the musical production of a play for children, La niña que riega la albahaca y el príncipe preguntón (The Girl that Waters the Basil and the Inquisitive Prince) adapted by Lorca from an Andalusian story. Inspired by the same structural form of sequence as “Deep Song,” his collection Suites (1923) was never finished and not published until 1983.

Over the next few years, García Lorca became increasingly involved in Spain’s avant-garde. He published a poetry collection called Canciones (Songs), although it did not contain songs in the usual sense. Shortly after, Lorca was invited to exhibit a series of drawings at the Galeries Dalmau in Barcelona, from 25 June to 2 July 1927. Lorca’s sketches were a blend of popular and avant-garde styles, complementing Canción. Both his poetry and drawings reflected the influence of traditional Andalusian motifs, Cubist syntax, and a preoccupation with sexual identity. Several drawings consisted of superimposed dreamlike faces (or shadows). He later described the double faces as self-portraits, showing “man’s capacity for crying as well as winning,” inline with his conviction that sorrow and joy were inseparable, just as life and death.

Romancero Gitano (Gypsy Ballads, 1928), part of his Cancion series, became his best known book of poetry. It was a highly stylised imitation of the ballads and poems that were still being told throughout the Spanish countryside. García Lorca describes the work as a “carved altar piece” of Andalusia with “gypsies, horses, archangels, planets, its Jewish and Roman breezes, rivers, crimes, the everyday touch of the smuggler and the celestial note of the naked children of Córdoba. A book that hardly expresses visible Andalusia at all, but where the hidden Andalusia trembles.” In 1928, the book brought him fame across Spain and the Hispanic world, and it was only much later that he gained notability as a playwright. For the rest of his life, the writer would search for the elements of Andaluce culture, trying to find its essence without resorting to the “picturesque” or the clichéd use of “local colour.”

His second play, Mariana Pineda, with stage settings by Salvador Dalí, opened to great acclaim in Barcelona in 1927. In 1926, García Lorca wrote the play The Shoemaker’s Prodigious Wife, which would not be shown until the early 1930s. It was a farce about fantasy, based on the relationship between a flirtatious, petulant wife and a hen-pecked shoemaker.

From 1925 to 1928, he was passionately involved with Dalí. Although Dali’s friendship with Lorca had a strong element of mutual passion, Dalí said he rejected the erotic advances of the poet. With the success of “Gypsy Ballads”, came an estrangement from Dalí and the breakdown of a love affair with sculptor Emilio Aladrén Perojo. These brought on an increasing depression, a situation exacerbated by his anguish over his homosexuality. He felt he was trapped between the persona of the successful author, which he was forced to maintain in public, and the tortured, authentic self, which he could acknowledge only in private. He also had the sense that he was being pigeon-holed as a “gypsy poet”. He wrote: “The gypsies are a theme. And nothing more. I could just as well be a poet of sewing needles or hydraulic landscapes. Besides, this gypsyism gives me the appearance of an uncultured, ignorant and primitive poet that you know very well I’m not. I don’t want to be typecast.”

Growing estrangement between García Lorca and his closest friends reached its climax when surrealists Dalí and Luis Buñuel collaborated on their 1929 film Un Chien Andalou (An Andalusian Dog). García Lorca interpreted it, perhaps erroneously, as a vicious attack upon himself. At this time Dalí also met his future wife Gala. Aware of these problems (though not perhaps of their causes), García Lorca’s family arranged for him to make a lengthy visit to the United States in 1929–30.

Green wind. Green branches. The ship out on the sea and the horse on the mountain. With the shadow at the waist she dreams on her balcony, green flesh, green hair, with eyes of cold silver.

From “Romance Sonámbulo”, (“Sleepwalking Romance”), García Lorca In June 1929, García Lorca travelled to the US with Fernando de los Rios on the RMS Olympic, a sister liner to the RMS Titanic. They stayed mostly in New York City, where Rios started a lecture tour and García Lorca enrolled at Columbia University School of General Studies, funded by his parents. He studied English but, as before, was more absorbed by writing than study. He also spent time in Vermont and later in Havana, Cuba.

His collection Poeta en Nueva York (Poet in New York, published posthumously in 1942) explores alienation and isolation through some graphically experimental poetic techniques and was influenced by the Wall Street crash which he personally witnessed.

This condemnation of urban capitalist society and materialistic modernity was a sharp departure from his earlier work and label as a folklorist. His play of this time, El público (The Public), was not published until the late 1970s and has never been published in its entirety, the complete manuscript apparently lost. However, the Hispanic Society of America in New York City retains several of his personal letters.