Veteran U.S. astronaut John Young, who walked on the moon and even smuggled a corned beef sandwich into orbit during one of his six missions in space, has died at age 87, NASA said on Saturday.

Young, a former U.S. Navy test pilot, in 1972 became the ninth of 12 people ever to set foot on the moon.

'We're saddened by the loss of astronaut John Young,' the National Aeronautics and Space Administration said in a statement on Twitter.

Veteran U.S. astronaut John Young (pictured), who walked on the moon and even smuggled a corned beef sandwich into orbit, died on Saturday at the age of 87

This 1965 photo made available by NASA shows John Young, who walked on the moon and later commanded the first space shuttle flight, during the Gemini 3 mission

The time and cause of Young's death was not immediately clear.

Young became one of the most accomplished astronauts in the history of the U.S. space program. He flew into space twice during NASA's Gemini program in the mid-1960s, twice on the Apollo lunar missions and twice on space shuttles in the 1980s.

He retired in 2004 after 42 years with the U.S. space agency.

The Apollo 16 mission in April 1972, his fourth space flight, took Young to the lunar surface.

As mission commander, he and crewmate Charles Duke explored the moon's Descartes Highlands region, gathering 200 pounds (90 kg) of rock and soil samples and driving more than 16 miles (26 km) in the lunar rover to sites such as Spook Crater.

Young (L) and Robert Crippen preview some of the intravehicular activity expected to take place during the orbiter's flight test, at Kennedy Space Center October 10, 1980

Young, along with astronaut Robert Crippen (R) hold a model of the space shuttle in this undated photo

In this April 1972 photo made available by NASA, Young salutes the U.S. flag at the Descartes landing site on the moon during the first Apollo 16 extravehicular activity

Recalling his lunar exploits, Young told the Houston Chronicle in 2004: 'One-sixth gravity on the surface of the moon is just delightful. It's not like being in zero gravity, you know. You can drop a pencil in zero gravity and look for it for three days. In one-sixth gravity, you just look down and there it is.'

Young's first time in space came in 1965 with the Gemini 3 mission that took him and astronaut Gus Grissom into Earth orbit in the first two-man U.S. space jaunt.

It was on this mission that Young pulled his sandwich stunt, which did not make NASA brass happy but certainly pleased Grissom, the recipient of the snack.

John W. Young, STS-1 mission Commander, prepares to log flight-pertinent data in a loose-leaf flight activities notebook onboard the Space Shuttle Columbia April 14, 1981

Astronaut Wally Schirra, who was not flying on the mission, bought the corned beef sandwich on rye bread from a delicatessen in Cocoa Beach, Florida, and asked Young to give it to Grissom in space.

During the flight, as they discussed the food provided for the mission, Young handed Grissom the sandwich.

NASA later rebuked Young for the antics, which generated criticism from lawmakers and the media, but his career did not suffer.

His May 1969 Apollo 10 mission served as a 'dress rehearsal' for the historic Apollo 11 mission two months later in which Neil Armstrong became the first person to walk on the moon.

Young and his crew undertook each aspect of that subsequent mission except for an actual moon landing.

Young's fifth space mission was as commander of the inaugural flight of NASA's first space shuttle, Columbia, in 1981.

He became the first person to fly six space missions in 1983, when he commanded Columbia on the first Spacelab trek, with the crew performing more than 70 scientific experiments.

He never went to space again. Young had been due to command a 1986 flight that was canceled after the explosion of the shuttle Challenger earlier that year.

He ended up as the only person to fly on space shuttle, Apollo and Gemini missions.

Young was born on Sept. 24, 1930, in San Francisco and grew up in Orlando, Florida. After receiving a degree in aeronautical engineering from the Georgia Institute of Technology in 1952, he entered the Navy and graduated from its test pilot school. NASA picked him in 1962 for its astronaut program.

This file photo taken on April 13, 1981 shows US Astronauts Robert Crippen (L) and John Young (R) smiling as they return after the first Columbia Space Shuttle flight in April 1981