Armstrong, who died last month in Ohio at age 82, walked on the moon in July 1969.
"He's now slipped the bonds of Earth once again, but what a legacy he left," former Treasury Secretary John Snow told the gathering.
Apollo 11 crewmates Buzz Aldrin and Michael Collins, Mercury astronaut John Glenn, 18 other astronauts, three NASA chiefs, and about two dozen members of Congress were among the estimated 1,500 people that joined Armstrong's widow, Carol, and other family members in the cavernous cathedral.
Collins read a prayer tailored to Armstrong's accomplishments and humility. A moon rock that the Apollo 11 astronauts gave the church in 1974 is embedded in one of its stained glass windows.
"You have now shown once again the pathway to the stars," Eugene Cernan, the last man to walk on the moon said in a tribute to Armstrong. "As you soar through the heavens beyond even where eagles dare to go, you can now finally put out your hand and touch the face of God."
Cernan was followed by a slow and solemn version of "Fly Me to the Moon" by singer Diana Krall.
The service also included excerpts from a speech 50 years ago by John F. Kennedy in which he said America chose to send men to the moon by the end of the 1960s not because it was easy, but because it was hard. The scratchy recording of the young president said going to the moon was a goal that "will serve to organize and measure the best of our energies and skills, because that challenge is one that we're willing to accept, one we are unwilling to postpone."
Shortly after that speech in 1961 at Rice University, Armstrong, not yet an astronaut but always a gifted engineer, was already working on how to land a spaceship on the moon, NASA administrator Charles Bolden recalled. Snow talked of the 12-year-old Armstrong who built a wind tunnel. But most of Armstrong's friends and colleagues spent time remembering the humble Armstrong. Snow called him a "regular guy" and "the most reluctant of heroes."
Bolden, a former astronaut, said Armstrong's humility and courage "lifted him above the stars."
"No one, but no one, could have accepted the responsibility of his remarkable accomplishment with more dignity and more grace than Neil Armstrong," Cernan said. "He embodied all that is good and all that is great about America."
Bolden read a letter from President Barack Obama saying, "the imprint he left on the surface of the moon is matched only by the extraordinary mark he left on ordinary Americans."
Armstrong commanded the historic landing of the Apollo 11 spacecraft on the moon July 20, 1969. His first words after stepping onto the moon are etched in history books: "That's one small step for man, one giant leap for mankind." Armstrong insisted later that he had said "a" before man, but said he, too, couldn't hear it in the recording.
Armstrong and Aldrin spent nearly three hours walking on the lunar surface while Collins circled above the moon. In all, 12 American astronauts walked on the moon before the last moon mission in 1972.
Armstrong was a U.S. Navy aviator. He joined NASA's predecessor agency in 1955 as a civilian test pilot and later, as an astronaut, flew first in Gemini 8 in 1966. After the moon landing he spent a year in Washington as a top official at the space agency, but then he left NASA to teach aerospace engineering at the University of Cincinnati. He later was chairman of two electronics companies, but mostly kept out of the public eye.
A private service was held earlier in suburban Cincinnati for Armstrong, who will be buried at sea.
In her homily Thursday, the Right Rev. Mariann Edgar Budde, Episcopal bishop for Washington, talked of how Armstrong sought to encourage young people to do even more, go even further.
Among the crowd in the cathedral was 14-year-old Shane DiGiovanna of Cincinnati, a young man who has spent his life grappling with an incurable skin disease and hearing loss. Shane idolized Armstrong and had always wanted to meet the first man on the moon, but it never happened.
But the eighth-grader met Cernan and former Apollo 13 commander James Lovell when they recently announced a memorial fund named for Armstrong at Cincinnati's Children's Hospital Medical Center, where Shane has been treated.
The Armstrong family invited Shane to join them at the Washington memorial service, something Shane called a "really big honor."
Just as Armstrong was working on the lunar lander after the Kennedy speech, Shane said he is now working on drawings of a lander for Mars. He wants to be an aerospace engineer.
"I'm hoping," Shane said, "to definitely contribute a lot to the next step."