Kelly's first spaceflight was as pilot of Space Shuttle Discovery during STS-103 in December 1999. This was the third servicing mission to the Hubble Space Telescope, and lasted for just under eight days. His second spaceflight was as mission commander of STS-118, a 12-day Space Shuttle mission to the International Space Station in August 2007.