At the invitation of some friends Agustín and Gloria went to Costa Rica in August of 1938 where they practically lived under patronage. These were difficult times that resulted in marital problems between Agustín and Gloria as the tension of the situation increased. Employment was scarce and Barrios health was retreating. One of Barrios masterpieces was written in that year, the barcarole Julia Florida.
Last years of Barrios’ life were spent in El Salvador. The very president, General Martínez, had invited him to recover his health in that country. Once Barrios felt better he got nominated Professor of guitar in the National Conservatory of Music.
In August 7, 1944, Barrios suffered an infarct that ended his life. He was 59 years old. The priest that accompanied Barrios’ last moments in agony recalls what he heard from the dying artist:
"I do not fear the past, but I do not know if I can overcome the mystery of the night."Barrios was buried in the following day in the Cementerio de Los Ilustres (Pantheon of Distinguished Men) in San Salvador.