Ayatollah Ruhollah Khomeini the leader, of Iran's Islamic revolution, declared today that his nation is engaged in an economic war with the United States and warned that "it is possible that military war will also come along."

The ayatollah's statement made to visitors at his headquarters in Qom, was seen as a new sign of defiance toward President Carter's appeal to the United Nations for economic sanctions and pressure for release of the American hostages held at the U.S. Embassy here since Nov. 4.

"We are in a war situation, an economic war which is in itself a struggle between Islam and blasphemy," he said, adding later: "Now we are at war, a political and economic war. It is possible that military war will also come along."

Khomeini's warning repeated earlier calls for armed resistance to any move by the United States to rescue the hostages in a commando operation or to mount a retaliatory raid. American clergymen who conducted Christmas services for the hostages reported fears of such an attack ran high among both the Islamic students occupying the embassy and their American captives as well.

The defiant anti-Western tone in Khomeini's speeches strikes a responsive chord in many Iranians, especially among the poor, but also among some of the middle class, whose economic status has been threatened by the Islamic revolution.

"You should hear people talking, particularly in my well-off neighborhood," said the son of a middle-class family from fashionable north Tehran. "They say they are willing to do without everything if the United States declared an embargo. As for me, it will probably mean only that my little daughter will do without Pampers."

Khomeini's bitter attitude toward the West also was illustrated in a talk he gave yesterday to a delegation of American clergymen led by the Rev. Jimmy Allen of San Antonio, Tex. Although this group of clergymen was not invited by the Iranian government and had no access to the hostages, it was received by the Iranian religious and revolutionary leader in Qom because of what knowledgeable sources said was confusion with another group of American clergymen invited by Iran to hold Christmas services for the hostages.

That group -- the Rev. William Sloane Coffin of the interdenominational Riverside Church in New York; the Rev. William M. Howard Jr., president of the National Council of Churches; and Catholic Auxiliary Bishop Thomas J. Gubleton of Detroit, Mich. -- were allowed to see the hostages inside the embassy on Christmas, but their request to see Khomeini was turned down.

Khomeini's comments to the American clergymen yesterday included a criticism of Pope John Paul II.

"The pope has condemned us for keeping Americans hostage," Khomeini said, according to a translation made available by the clergymen who got in to see him. "How does he know who they are and what they have done in Iran? How can he criticize a weak country and take the side of a strong country?

"Don't you see how they are putting pressure on us, putting on an economic blockage in order to make 35 million peope die of starvation?" he went on. "Is the pope informed of this? If he is, God help us and God help the Christians. If he is not, God help the Vatican."

Another effort to get talks started with Iranian authorities was renewed today by Rep. George Hansen, (R-Idaho), who returned to Tehran "to take another look and give it a little push." Hansen, who says he is acting on his own, became the first American connected to the government to see the hostages late last month, when he briefly visited fewer than 20 of them.

Although he encountered some criticism from Washington for his one-man diplomatic efforts here earlier, Hansen said today he plans this time to "look and maybe throw a few new things into the hopper."

The congressman, who has a reputation for wading into international problems far from his home state of Idaho, said he had no specific invitation from Iranian authorities and no pledges that they would see him.