WASHINGTON — President Donald Trump signed a bill into law Tuesday that updates NASA’s mission to add exploration of Mars and authorizes $19.5 billion in spending for the U.S. space agency for the current budget year.

It’s the first time in seven years that there has been an authorization bill for the National Aeronautics and Space Administration, also known as NASA, said Sen. Ted Cruz, R-Texas, a chief sponsor of the bill. Cruz joined several astronauts and other lawmakers in the Oval Office to watch Trump sign the bill.

Last week, Trump sent Congress a budget proposal that would authorize $19.1 billion in agency spending next year. Congress appropriates funding for all government departments and agencies.

“For almost six decades, NASA’s work has inspired millions and millions of Americans to imagine distant worlds and a better future right here on earth,” Trump said. “I’m delighted to sign this bill. It’s been a long time since a bill like this has been signed, reaffirming our commitment to the core mission of NASA: human space exploration, space science and technology.”

The measure amends current law to add human exploration of the red planet as a goal for the agency. It supports use of the International Space Station through at least 2024, along with private sector companies partnering with NASA to deliver cargo and experiments, among other steps.

Trump invited several lawmakers to comment after the signing, starting with Cruz before moving on to Sen. Marco Rubio, R-Fla. When Trump invited Vice President Mike Pence to speak, Pence suggested that former astronaut and Sen. Bill Nelson, D-Fla., be allowed to say a few words.

“He’s a Democrat. I wasn’t going to let him speak,” Trump quipped, to laughter. Nelson did say a few words, praising the bill for putting the agency on a “dual track” with commercial companies making roundtrips to the International Space Station and NASA continuing to explore the universe.

This story has been corrected to show that authorization is for the 2017 budget year, instead of 2018.