He was the command module pilot on the Apollo 16 flight, the fifth crewed Moon-landing mission, during which he carried out more than an hour of extravehicular activity. He was spacecraft commander for two space shuttle flights: on the final orbital test flight of the space shuttle Columbia (June 1982), and on the Discovery mission (January 1985) that deployed an Inertial Upper Stage rocket. Mattingly was selected as an astronaut in 1966, and left NASA in 1985.