In the early 1990s, scientists believed that gravity should be slowing the expansion of the universe. However, in 1998 observations of very distant supernovae showed that a long time ago the universe was actually expanding more slowly than it is today. So the expansion of the universe has not been slowing due to gravity, as everyone thought. Instead it has been accelerating.
More information: https://svs.gsfc.nasa.gov/20246