Iran's revolutionary authorities today released a wounded U.S. marine who had been secretly arrested and held for a week after being seized from his hospital bed following a guerrilla attack on the U.S. Embassy.

The release, in which President Carter and Secretary of State Cyrus Vance reportedly took personal interest, came shortly after a high Iranian official said preparations were being made to take legal actions against the marine for unspecified "crimes" committed during the attack.

White House press secretary Jody Powell told reporters that Carter and Vance had "made it their number one priority" to get the marine, Sgt. Ken Kraus, 22, released.

Upon learning of Kraus' release, Powell said, Carter called the marine's mother, Jane Kraus, in Lansdale, Pa., to tell her he was once again in the U.S. Embassy.

Kraus, who had been imprisoned at the headquarters of Ayatollah Ruhollah Khomeini, was accompanied by a U.S. Embassy officer and an official of Khomeini's revolutionary committee when he was returned to the embassy.

The embassy, which earlier covered up Kraus' abduction by armed men from his hospital bed, had no comment on his release.

Indicative of the confusion that has arisen between Khomeini's revolutionary committee, the effective ruler of Iran, and the nominal government was a statement this morning by Assistant Prime Minister Amir Entezam implying that Kraus would be tried for "crimes" committed at the time of the Feb. 14 attack on the U.S. Embassy.

"Regarding his crimes, investigations are going on and after they are completed, certain action will be taken," Entezam said.

Kraus was wounded when leftist guerrillas stormed the embassy a week ago. After surrendering his shotgun to the attackers, he was ordered to turn over heavier weapons. A guerrilla who did not believe his explanation that he had no other weapons then fired at Kraus from close range with Kraus' shotgun, sending him to the hospital with superficial skin wounds.

According to friends, Kraus was kidnaped about four hours after he had been admitted to the hospital, and after he had described the attack to reporters in bedside interviews. Armed men showed papers to hospital orderlies that indicated they were authorized to arrest Kraus in the name of the Khomeini committee.

Kraus was blindfolded, handcuffed and taken away while he was still wearing hospital pajamas, his friends said.

Asked yesterday about the reports of his arrest, an embassy spokesman said that he had been transferred to another hospital.

Iranian sources had indicated the Khomeini committee was considering trying to blame Kraus for the deaths of three guerrillas killed during the embassy attack. The guerrillas were apparently killed by cross fire from other attackers, since the embassy's marine guards had been shooting back only with tear gas and bird shot.

Meanwhile today, the Marxist guerrilla group held responsible for launching the embassy attack called off a demonstration scheduled for Thursday after it was banned by Khomeini.

Instead of staging a cross-town march to Khomeini's headquarters, the Cherikhaye Fedaye Khalq (People's Sacrifice Guerrillas) announced they would hold a rally at Tehran University, a leftist stronghold, on Friday.

Although the leftists nominally support Khomeini and planned to carry his portrait in the march, the demonstration was mainly intended to promote Marxist goals such as formation of a "people's army," representation on Khomeini's revolutionary council and, eventually, establishment of an Iranian socialist state.

The march was also evidently aimed at challenging Khomeini personally with a leftist show of strength in the streets of Tehran.

Accusing the organizers of using "deceptive slogans of liberation and brotherhood" and trying to "create dissent among our masses," Khomeini ordered his followers not to join their demonstration.

"I will not permit these opportunists to come to my house," he said. Aides at his committee said flatly that the organizers were communists.

By postponing the demonstration and making it a campus rally instead of a march, the Fedaye appears to have temporarily headed off an open conflict with Khomeini -- a fight that neither side appears strong enough to win at this point.

In another challenge to the government, Kurdish rebels shot and wounded an Iranian general in the western province of Kurdistan bordering Iraq, authorities said.

Referring to apparently rising Kurdish separatist sentiment in the region, Assistant Prime Minister Entezam warned, "The government will ruthlessly crush those provoking Kurdish unrest."

Meanwhile, moderate Kurds issued a series of demands calling for negotiations with the central government on granting Iranian Kurds autonomy under a federal system. The demands, presented to a government fact-finding mission by a Kurdish ayatollah, also called for an end to "economic injustice" in the region by granting more state development aid.

Iran's new government today said it will hold a referendum within 15 days on whether the nation should be changed from a monarchy to an Islamic republic. The referndum could be used to provide measurable legitimacy for Khomeini's rule.

A message of support for the harried government -- perhaps unwelcome under the circumstances -- came from Cuban President Fidel Castro praising the "struggle of the Iranian nation" as an example for the rest of the world. The message said Cuba has been training "Iranian partisans" for the past 15 years.