"In 2019, we also celebrate 50 years since brave young pilots flew a quarter of a million miles through space to plant the American flag on the face of the moon," said Mr Trump.
"Half a century later, we are joined by one of the Apollo 11 astronauts who planted that flag: Buzz Aldrin. This year, American astronauts will go back to space on American rockets."
Mr Aldrin, 89, later said on Twitter that it was an "honour" to be at the State of the Union and "to hear of Mr Trump's resolve to pursue America's greatness in space".
He earlier tweeted an image of himself saluting the President, commenting that he was "proud to serve the USA".
Mr Aldrin, who joined Neil Armstrong on the lunar surface in July 1969, was at the White House last June for President Trump's announcement directing the Pentagon to create a "Space Force" as a new military branch.