Top NASA officials, fellow astronauts, relatives and well-wishers paid a final tribute to Neil Armstrong, the first man on the moon, in a sombre memorial ceremony on Thursday in the US capital.
A bagpiper led family members in a procession through the packed Washington National Cathedral, followed by a US Navy honour guard for Armstrong, who was a Navy pilot before joining the space programme.
The celebrated astronaut, who died on 25 August at the age of 82, was decorated by 17 countries and received a slew of US honours, but was never comfortable with his fame and shied away from the limelight.
Armstrong took the "first small step on a world beyond our own, but it was the courage, grace and humility he displayed throughout his life that lifted him above the stars," said NASA chief Charles Bolden at the service.
"America's leadership in space, and the confidence we can go farther into the unknown, rests with the achievements of Neil and the brave men with which he served."
He added that as "a small token of our esteem" the agency was presenting the family with the flag that flew above NASA control the day Armstrong died.
A recorded excerpt of then-President John F Kennedy's famous speech, given 50 years ago on Wednesday, was played in the cathedral, reminding mourners that the US pledged to go to the moon and commit to other accomplishments to win the Cold War space race "not because they are easy, but because they are hard".
Bolden also quoted from a letter President Barack Obama sent on Thursday to Armstrong's wife, Carol, and his family.
"Future generations will draw inspiration from his spirit of discovery, humble composure and pioneering leadership in setting a bold new course for space exploration," the president said.
"The imprint he left on the surface of the moon and the story of human history is matched only by the extraordinary mark he left on the hearts of all Americans."
Sitting in the front pew were fellow Apollo 11 astronaut Buzz Aldrin, who walked on the moon just steps behind Armstrong, and Senator John Glenn, the first man ever to orbit the Earth.
Eugene Cernan, the last man to walk on the moon, also paid tribute.
"No one, but no one, could have accepted the responsibility of his remarkable accomplishment with more dignity and more grace than Neil Armstrong," said Cernan, calling the first moonwalker a good friend who had never wanted to own his remarkable accomplishment.
"It was never about Neil - it was about you, your mothers and fathers, your grandparents, about those of a generation ago who gave Neil the opportunity to call the moon his home," he said.
He bid farewell to his friend, saying "wherever you are up there, almost a half a century later you have now shown, once again, the pathway to the stars.
The grainy black-and-white broadcast of Armstrong's 20 July 1969 moon walk was seen on television by an estimated half a billion people.
"That's one small step for man, one giant leap for mankind," they heard Armstrong say, though he later claimed that an "a" before the word "man" had been lost in transmission.
The Washington cathedral includes the famous stained glass Space Window, housing a moon rock brought back by Armstrong and Aldrin.
In his tribute, Bolden said the window is "a reminder not only of their significant human accomplishment," but that these monumental "achievements are made possible through God's grace."
The public memorial came two weeks after a small, invitation-only funeral, that reflected Armstrong's intensely private nature.
The Apollo 11 commander, who died of complications from cardiovascular surgery, will be buried at sea on Friday, according to a family spokesperson.