The Soviet Union agreed yesterday to release seven anti-whaling activists on Saturday and to deliver them at sea to the Rainbow Warrior, the ship that they used to "invade" Siberia and that their colleagues used to escape.

State Department officials said that the Soviets set at least two conditions for the transfer: It had to be done at sea, and the State Department had to send along an official representative of the U.S. government.

The department deputized Leo Rasmussen, the mayor of Nome, Alaska, to make the trip on behalf of the government.

"He's the most convenient official," one source explained. "We don't have many government officials in Nome."

The seven "detainees," as the State Department calls them, are scheduled to step from a Soviet ship to the Rainbow Warrior at 4 a.m. Saturday in the Bering Sea, north of St. Lawrence Island, a reindeer station reservation. The Warrior was to sail from Nome last night, with Rasmussen and most of its remaining crew aboard.

The seven detainees were among 22 members of Greenpeace, a pacifist and environmental group, who sailed into Soviet waters on Monday aboard their 147-foot converted trawler to spy on a whale-processing plant in the coastal village of Lorino and to distribute anti-whaling literature.

The other 15 crew members, who escaped in the Rainbow Warrior across the Bering Straight to Nome, claim that Soviet soldiers arrested their friends, seizing six as they passed out Russian-language anti-whaling leaflets to Lorino residents and plucking the seventh from a motorboat as he attempted to flee.

The official Soviet news agency Tass, in its first comment on the incident, said yesterday that the group "deliberately violated the Soviet state frontier, thereby creating a dangerous incident."

Tass also said that Greenpeace member Jim Henry of Orrs Island, Maine, capsized in the motorboat because of "irresponsible actions" by his friends.

"The ship left the Soviet territorial waters, leaving the man in distress, at the mercy of fate," Tass reported. "The possible tragic consequences were averted by Soviet frontier guards who sent a helicopter into the air and saved the drowning man."