A "deeply saddened" President Barack Obama has hailed late US space pioneer Neil Armstrong as one of America's greatest ever heroes, for having inspired a generation to reach for the stars.

Armstrong, the first person to set foot on the moon, died after suffering complications from cardiovascular surgery, his family said earlier. He was 82.

"When he and his fellow crew members lifted off aboard Apollo 11 in 1969, they carried with them the aspirations of an entire nation," Obama said in a statement.

"They set out to show the world that the American spirit can see beyond what seems unimaginable - that with enough drive and ingenuity, anything is possible. And when Neil stepped foot on the surface of the moon for the first time, he delivered a moment of human achievement that will never be forgotten."

Obama, who was just under eight years old when Armstrong and his fellow Apollo 11 astronaut Buzz Aldrin landed on the moon on July 20, 1969, said: "Neil was among the greatest of American heroes - not just of his time, but of all time.

"Today, Neil's spirit of discovery lives on in all the men and women who have devoted their lives to exploring the unknown - including those who are ensuring that we reach higher and go further in space.

"That legacy will endure - sparked by a man who taught us the enormous power of one small step."

Obama's Republican challenger for the White House, Mitt Romney, said Armstrong now "takes his place in the hall of heroes".

"With courage unmeasured and unbounded love for his country, he walked where man had never walked before," Romney said. "The moon will miss its first son of Earth."

Pentagon chief Leon Panetta bid farewell on behalf of the US military to one of its own.

"As a decorated Korean War veteran, as an astronaut for Nasa, and as the first man to walk on the moon, Neil inspired generations of Americans to believe that as a nation we are capable of achieving greatness that only comes with determination, perseverance and hard work," the US defence secretary said.

"As a true pioneer, his one small step showed all mankind the great feats we can accomplish when we set ourselves to the task."