He flew with the Endeavour space shuttle mission in January 1998 that docked with the Russian space station Mir for the fifth and last exchange of an astronaut. In July 2001 he flew aboard Atlantis to install a new airlock module on the International Space Station (ISS). He later moved to the Astronaut Office to lead shuttle training, before he flew once again into space aboard space shuttle Atlantis to the ISS; during the mission, Reilly accumulated 14 hours and 40 minutes of EVA in two space walks. Reilly was selected as an astronaut in 1994 and retired from NASA in May 2008. During his career he logged over 853 hours in space, including five space walks totalling 31 hours and 10 minutes. In 2018 he was confirmed Director of the US Geological Survey.