Flags flew at half mast across the US as family and friends gathered in Ohio to remember Neil Armstrong, the first man to walk on the moon.
Four US Navy F-18 fighter jets flew in a "missing man" formation over the funeral at a private Cincinnati golf club.
Armstrong, the commander of the historic Apollo 11 mission, died last Saturday at the age of 82.
Charles Bolden, head of US space agency Nasa, said: "Neil Armstrong's first step on the moon paved the way for others to be the first to set foot on another planet.
"We have an obligation to carry on this uniquely American legacy.
"A grateful nation offers praise and salutes a humble servant who answered the call and dared to dream."
The late-morning funeral at the exclusive Camargo Club was by invitation only, reflecting Armstrong's own intensely private nature.
A public memorial is planned for September 12 in Washington DC.
Among the mourners was Armstrong's wife Carol, his sons Eric "Rick" Armstrong and Mark Armstrong, and Piper Van Wagenen, one of his 10 grandchildren.
On Monday, US President Barack Obama ordered that flags at all government premises be lowered to half mast to mark the funeral.
His order applied to the Stars and Stripes on top of the White House, all public buildings, military posts, naval stations and US naval ships at sea anywhere in the world, as well as at embassies and consulates.
Armstrong, who grew up in rural Ohio and flew in the US Navy before joining the space programme, became a Cold War hero when he set foot on the moon on July 20, 1969.
The Apollo 11 commander, who died of complications from cardiovascular surgery, was decorated by 17 countries and received a slew of US honours, but he was never comfortable with his fame and shied away from the limelight.
Earlier in Cincinnati, lunar astronauts James Lovell and Eugene Cernan helped launch a charity in Armstrong's memory at the Cincinnati Children's Hospital Medical Centre.
Armstrong's family had already requested that in lieu of flowers, donations be made to the charity, known as the Neil Armstrong New Frontiers Initiative.
Mr Lovell was commander of the ill-fated Apollo 13 that aborted its mission and returned to Earth after an oxygen tank exploded in space, while Mr Cernan was in December 1972 the last of the 12 men to have walked on the moon.
Both men attended the funeral, along with Apollo 8 astronaut Bill Anders, according to local news reports.