The astronaut John Young, who walked on the moon and flew the first space shuttle mission, has died aged 87.

He visited space six times including on Apollo and Gemini missions, Nasa said.

In a statement, the agency tweeted: “We’re saddened by the loss of astronaut John Young, who was 87.

“Young flew twice to the Moon, walked on its surface & flew the first Space Shuttle mission.

“He went to space six times in the Gemini, Apollo & Space Shuttle programs.”

Mr Young’s career at Nasa stretched for 42 years, during which he became the first human to fly in space six times.

When he retired in 2004, Nasa administrator Sean O’Keefe said that “when you need a job done and you want it done right, John’s the person to go to,” calling Mr Young a “true American treasure”.

Paying tribute, astronaut and space shuttle pilot Terry Virts tweeted: “You were one of my heroes as an astronaut and explorer and your passion for space will be missed.”

Mr Young’s first space flight was in 1965, aboard the first manned Gemini launch on which he smuggled a corned beef sandwich – to the outrage of his superiors.

Following a further Gemini mission he orbited the moon in 1969, two months before the Apollo 11 landing. He returned to the satellite in 1972, when he landed on its surface to collect samples.

The former US Navy captain also helmed the space shuttle Columbia on its first flight in 1981. His final mission came in 1983.

Chastened by the 1967 Apollo launch pad fire that killed three astronauts, Mr Young spoke up after the 1986 Challenger launch accident. His hard scrutiny continued well past shuttle Columbia’s disintegration during re-entry in 2003.

“Whenever and wherever I found a potential safety issue, I always did my utmost to make some noise about it, by memo or whatever means might best bring attention to it,” he wrote in his 2012 memoir, Forever Young.

Mr Young remained an active astronaut into his early 70s and held on to his role as Nasa’s conscience until his retirement in 2004.

“You don’t want to be politically correct,” he said in a 2000 interview. “You want to be right.”

Nasa unveils space tourism posters Show all 6 1 /6 Nasa unveils space tourism posters Nasa unveils space tourism posters Nasa space tourism posters Nasa's canny decision to commission sumptuous vintage-inspired posters by Seattle design firm Invisible Creature has firmly placed space travel back where it belongs: in the imagination of travellers Nasa Nasa unveils space tourism posters Nasa space tourism posters It is particularly fitting that the Nasa commission went to Don and Ryan Clark, who have been running Invisible Creature since 2006, undertaking projects for the likes of Nike and Target Nasa Nasa unveils space tourism posters Nasa space tourism posters "We were ecstatic, just because our grandfather was an illustrator at Nasa for 30 years," says Clark Nasa Nasa unveils space tourism posters Nasa space tourism posters The artwork harks back to the Jet Age-era posters commissioned by Howard Hughes' Trans World Airlines and its rival United in the 1950s and 1960s, when the work of David Klein (for TWA) and Stan Galli (for United) glamorised and essentially branded this new age of air travel Nasa Nasa unveils space tourism posters Nasa space tourism posters It doesn't matter that Nasa has no plans for a "Grand Tour" of Jupiter, Saturn, Neptune and Uranus Nasa Nasa unveils space tourism posters Nasa space tourism posters If global travel is for daydreamers, going beyond the atmosphere is for true space cadets Nasa

Mr Young was in Nasa’s second astronaut class, chosen in 1962, along with the likes of Neil Armstrong, Pete Conrad and James Lovell.

Throughout the 1990s and into the 2000s, Mr Young maintained Nasa should be developing massive rockets to lift payloads to the moon to industrialise it, he said, and building space systems for detecting and deflecting comets or asteroids that could threaten Earth.

“The country needs it. The world needs it. Civilisation needs it,” he said in 2000, adding: “I don’t need it. I’m not going to be here that long.”

Mr Young spent his last 17 years at Johnson Space Centre in Houston in management, focusing on safety issues.

He was born in San Francisco in September 1930 and died on Friday.