Congress amended the Iran Nonproliferation Act this week, allowing U.S. astronauts to continue to fly aboard Russian spacecraft and forestalling the possibility that the United States would lose access to the international space station.

The Senate, which drafted the original amendment, unanimously approved a modified version of the bill late Wednesday, after similar House action two weeks ago. The amendment will be sent to the White House, where President Bush is expected to sign it.

The House also easily passed NASA's $16.5 billion budget for 2006. Lawmakers largely followed the administration's wishes in sculpting a program that emphasized Bush's initiative to return humans to the moon by 2020 and eventually send them to Mars. The Senate was expected to easily pass the identical bill.

Congress did disagree with the administration by adding $60 million to an aeronautics budget that NASA wished to cut. The bill also earmarked more than $300 million for special projects sought by individual lawmakers.

"I wanted to not have any earmarks," said Rep. Frank R. Wolf (R-Va.), chairman of the Appropriations subcommittee on science, State, Justice, Commerce and related agencies. "But you have to negotiate to get a bill." NASA's budget is part of the subcommittee's spending bill.

The need for an amendment to the Iran Nonproliferation Act became apparent after the 2003 Columbia disaster grounded the space shuttle, forcing U.S. astronauts to rely for prolonged periods on Russian Soyuz spacecraft to get to and from the space station.

The act, passed in 2000, prohibits U.S. agencies from purchasing most Russian space technology and know-how, including seats aboard Soyuz, unless the president certifies that Russia is not exporting nuclear and missile technology to Iran. Administration officials have said there was never any possibility that Bush would make such a certification.

The prohibition never took effect because a previous agreement required Russia to provide 11 free Soyuz trips to the United States. The flight that took the new crew to the space station last month was the 11th, and Russia had made it clear it would only carry paying customers in the future.

In July, NASA Administrator Michael D. Griffin sent Congress a proposed amendment that would have allowed the United States to buy Russian space technology for as long it wished, but the bill passed this week terminates all purchases and contracts by Jan. 1, 2012.

In addition, the amendment broadens the underlying sanctions policy to include nuclear imports by Syria and imports by both Iran and Syria from governments as well as "any foreign governmental entity acting as a business enterprise." It also strengthens the law to cover nuclear exports from Iran and Syria as well as imports by those countries.

"Congress' action helps to ensure the continuous presence of U.S. astronauts on the International Space Station," Griffin said in a statement. "The legislation . . . reflects the U.S. government's continuing commitment to nonproliferation objectives, but also recognizes the value of international cooperation in space exploration."