Both. They occur at approximately the same time. However, if we’re at a distance from a storm, we see lightning before we hear thunder because light travels much faster than sound.