John Glenn, the first US astronaut to orbit the Earth and who later had a long career in the US Senate, has died aged 95.

The last survivor of the original Mercury 7 astronauts died at the James Cancer Hospital in Columbus, Ohio, where he had been treated for more than a week.

Glenn was the third US astronaut in space and the first of them to get into orbit. He circled the Earth three times in 1962.

The Soviet Union leaped ahead in space exploration by putting the Sputnik 1 satellite in orbit in 1957, and then launched the first man in space, cosmonaut Yuri Gagarin, but when Glenn became the first American to orbit the Earth, he was immediately propelled to national hero status.

Glenn then spent 24 years as a Democrat from Ohio in the Senate - and made a failed run for president in 1984.

It was his long political career which enabled him to return to space in the shuttle Discovery aged 77 in 1998, a cosmic victory lap that he relished and turned into a teachable moment about growing old.

He got to move around aboard the shuttle for far longer - nine days compared with just under five hours in 1962 - as well as sleep and experiment with bubbles in weightlessness. He holds the record for the oldest person in space.

He is survived by his wife Anna, whom he married in 1943 after the pair met as toddlers. He bought her a diamond engagement ring in 1942 for 125 US dollars and it was never replaced.

They had two children, Carolyn and John David.

Writing in 2012, he said: "I've been very fortunate to have a lot of great experiences in my life and I'm thankful for them."

As tributes poured in to Glenn, many mentioned the phrase that first sent him into orbit: "Godspeed, John Glenn."

President Barack Obama said: "When John Glenn blasted off from Cape Canaveral atop an Atlas rocket in 1962, he lifted the hopes of a nation. And when his Friendship 7 spacecraft splashed down a few hours later, the first American to orbit the Earth reminded us that with courage and a spirit of discovery, there's no limit to the heights we can reach together.

"The last of America's first astronauts has left us, but propelled by their example we know that our future here on Earth compels us to keep reaching for the heavens. On behalf of a grateful nation, Godspeed, John Glenn."

President-elect Donald Trump tweeted: "Today we lost a great pioneer of air and space in John Glenn. He was a hero and inspired generations of future explorers. He will be missed."

House Speaker Paul Ryan said: "May his memory live on every time we look up at the stars," while Nasa administrator Charles Bolden added: "His missions have helped make possible everything our space programme has since achieved and the human missions to an asteroid and Mars that we are striving toward now."