The Iranian terrorists holding American hostages violated international law, the press officer for the Embassy of Iran said tonight, but the capture of the Americans 86 days ago was justified because of America's past support for the deposed Shah, he said.

The press officer, Sasan Ardalan, spoke before more than 500 persons at a forum here sponsored by the University of Virginia. He was responding to remarks made an hour earlier from the same podium by Deputy Assistant Secretary of State Thomas Reston, who had said there was "nothing to justify" the hostages' capture.

The two men went through a delicate diplomatic ballet to avoid seeing each other at the forum.

The reception from the audience to Ardalan was at times openly hostile, or derisive. When he said the taking of the hostages was a "democratic act" because "it represented the will of the people," even though it was a clear violation of international law, the audience laughed.

Ardalan responded by saying, "I hate to say this but without the hostage situation you would never have been aware of the misery caused by the shah." When he finished that statement, he got sustained applause.

Ardalan, a 23-year-old graduate of North Carolina State University, said that only "a return of the shah" would free the hostages. He said that if a trial of the hostages were held, as the activists controlling the American Embassy in Tehran have suggested, then the trial would "really" be a trial of American foreign policy. The hostages themselves would not be punished, he said.

"It isn't easy to defend the students, but please excuse me if I try," Ardalan said. He repeated referred to what he called "torture and murder" of Iranians by the U.S.-backed forces of the shah as justification of the hostages' capture.

When asked about support in so-called Third World countries for economic sanctions against Iran, Ardalan said, "the Third World is in pretty bad shape."

He added that American correspondents had been thrown out of Iran because of "slanted" reporting which had failed to tell the American public about the shah's alleged brutality.

Reston, the State Department spokesman, said the American government had no fundamental problem with the religious government in Iran but "the problems we have with them are tied up in a basement somewhere," referring to the hostages' confinement.

Reston said the State Department had been "warned three or four months prior to the embassy takeover" last November that such an action was anticipated. "Were we naive" in leaving personnel in the embassy, he asked. "That is being debated in private now and will be debated publicly later on. . . . Personally, I don't think so. . . . No number of Marines can protect an embassy (seized) . . . with the connivance of the local government," he said.

Reston responded to a question about possible political backlash against President Carter by saying a backlash would depend on the manner in which the hostages are released. "If they are put to the sword . . . or brought out in a demeaning humilitating way," Reston said, a backlash was likely.

Reston said the State Department had "an insufficient appreciation of what was happening in the Islamic world of Iran" prior to the takeover. He called the Soviet Union's Security Council veto of UN economic sanctions against Iran "a craven act" and said that "neutral international observers" were needed to fully report the hostages' condition.

Both men agreed to speak at the forum prior to the election of Iraniana president-elect Abol Hassan Bani-Sadr. Ardalan said before he spoke that he had come to the forum as a way of "lowering tensions . . . and strengthening the bond between Iran and the U.S."