Stably stratified fluids, such as stellar and planetary atmospheres, can support and propagate gravity waves. On Earth these waves, which can transport energy and momentum over large distances and can trigger convection, contribute to the formation of our weather and global climate. Gravity waves also play a pivotal role in planetary sciences and modern stellar physics. They have also been proposed as an agent for the heating of stellar atmospheres and coronae, the exact mechanism behind which is one of the outstanding puzzles in solar and stellar physics. Using a combination of high-quality observations and 3D numerical simulations we have the first unambiguous detection of propagating gravity waves in the Sun's (and hence a stellar) atmosphere. Moreover, we are able to determine the height dependence of their energy flux and find that at the base of the Sun's chromosphere it is around 5 kW m-2. This amount of energy is comparable to the radiative losses of the entire chromosphere and points to internal gravity waves as a key mediator of energy into the solar atmosphere.