We can see the sun before it has actually risen above the horizon (advance sunrise) and can see the sun for sometime after it has set below the horizon (delayed sunset), all because of atmospheric refraction.
Advance sunrise and delayed sunset is due to atmospheric refraction. Because of this, sun is visible about 2 minutes earlier than actual sunrise and till about 2 minutes after the actual sun set.