A Soviet atomic reactor will soon be on its way home after being stranded on American soil for nearly five months and straining superpower nerves.

The Nuclear Regulatory Commission reversed course Tuesday and agreed to allow the reactor, which was brought to this country for a scientific display, to be returned to the Soviet Union.For months the NRC had refused to issue an export license, arguing that to do so would violate the U.S. Atomic Energy Act.

The unusual string of events began in January when the Topaz II, a reactor designed for use in space, was shipped to the United States to be shown at the Space Nuclear Power Symposium in Albuquerque, N.M.

The reactor was a hit.

A U.S. research consortium even reached a tentative agreement to buy one of the reactors. Pentagon officials involved in the Star Wars missile defense program also took a keen interest.

But then the NRC, which had granted an import license, refused to grant an export license.