The present invention relates to a nutritional or pharmaceutical composition for the treatment or prevention of gastroesophageal reflux disease comprising at least one salt of alginic acid and a salt of hyaluronic acid. The nutritional or pharmaceutical composition according to the invention has the advantage of being able to be used for the treatment or prevention of gastroesophageal reflux disease by acting, through the formation of a spongy gel, as a protective barrier that mechanically protects the walls of the gastroesophageal mucosa from possible erosion by acid in the contents of the stomach. According to the invention, a dietary supplement that comprises said nutritional or pharmaceutical composition for the treatment or prevention of gastroesophageal reflux disease is also provided.