Ayatollah Ruhollah Khomeini today called for a purge of "seditious elements" in his revoulutionay committiees in an apparent attempt to defuse growing criticism of the supragovernmental organizations under his control.

Khomenini's statement evidently came as the result of a compromise between him and Ayatollah Mahmoud Taleghani, another popular Shiite Moslem leader who had become a ralying figure for Iranians discontented with the excesses of Khomeini's revolutionary committees.

After a meeting between the two ayatollahs in the holy city of Qom, the government announced that the committees must inform the police of any suspected crimes and that "criminals" must be handed over to the police.

Courts will no longer be allowed to accept complaints without police investigation, as opposed to denunciations by the committees.

In an appearance tonight on national television, Taleghani said he accepted the leadership of Ayatollah Khomeini.

"I believe in his sincerity, decisiveness and competence," Taleghani said. "Everyone has some differences of opinion, but they must not be exploited by seditionists foreign elements and opportunists."

Taleghani said he rejected attacks on the committees. He added, however, that "some irresponsible people have penetrated the committees and made trouble in the name of revolutionary guards thought they have nothing to do with the real revolutionary guards."

Protect marches demanding Taleghani's return to Tehran abated today following his meeting with Khomeini to thrash out their problems.

The state-run radio, "Voice of the revolution," said their talks Wednesday night in the shrine city 90 miles south of Tehran had been "fruitful," but gave no other details.

Taleghani, 72 left the capital for a country retreat last Friday after two of his sons and a daughter-in-law had been detained for 16 hours and beatne by militiamen from a Khomeini committee. The incident served as a catalyst for protest demonstrations by liberal, leftist and radical Islamic groups that fear increasing suppression by the Khomeini forces.

Meanwhile, Ayatollah Seyed Kazem Shariatmadari, the country's second-ranking Shiite leader after Khomeini, criticized the Soviet Union for its treatment of Moslems and for its support of "harsh behavior" toward Afghan Moslem by the Moscow backed government in Kabul.

According to the Iranian radio, Shariatmadari told Soviet correspondents in Qom that Moscow should give more freedom to the more than 50 million Moslems in the Soviet Union. The radio quoted Shariatmadari as calling on Moscow to take steps to "stop the Afghanistan government's harsh behavior" toward fellow Moslems there.

The radio said Khomenin met in Qom with the chief of 14 revolutionary Khomeithehs, or committees, operating in Tehran. He told them that the much-criticized militia organizations would not be dissolved, but that they should, in effect, clean up their acts.

"Reform the committees," he told the militia chiefs. "Expel corrupt individuals and put honest people to work."

Khomeini said the committees would continue their activities until "the authority of the government as been established."

"He will not set aside the revolutionary guards to leave the door open for the enemy," he added. "We will strengthen the guards and the committees until the day the government can execute its affairs from a position of strength."

He did not say who the enemy is. He also did not address the apparent paradox of some government officials' complaints that they cannot wield their authority while the committees or members of Khomeini's entourage co-opt or meddlle in the affairs of their ministires.

This situation was the mmain factor behing the recent resignation of foreign minister Karim Sanjabi, government sources said.

In the remarks carried by the radio, Khomeini renewed accusations that "enemies" affiliated with the United States were stirring unrest in Iran and "even creating differences and disputes among religious leaders to reach their goals."

Government spokesman and Deputy Prime Minister Abbas Amir Entezam said authorities were trying to solve the problem of the controversial committees by bringing them under a "centralized power" with better organization. "In the future the committees will be guided by the government," he said.

Entzam rejected the growing demands by liberals and leftists that the secret Revolutionay Council, which nominally runs the committees and the revolutionay tribunals, he publicly identified and its activities explained. He said the council members' responsibilities are "decided by themselves and Khomeini. Nobody has the right to question the Revolutionary Council and is not going to have that right in the future."

Earlier Entezam announced at a news conference that the government will ban imports of all foreign cars, pork, alcoholic beverages, sculpted images and luxury items deemed un-Islamic by the leaders of Iran's new Islamic republic. There was no immediate word on when the ban will take effect and what other items it will include.

In another development, Justice Minister Assadollah Mobasheri, who threatened to resign recently over the resumption of summary trials and executions outside his jurisdiction, told a Tehran newspaper that Khomeini would soon announce a general amnesty for former officials under the shah, except "torturers and those whose hands are covered with blood."

Revolutionary courts meanwhile executed four more persons today, bringing the total shot so far by Khomeini's firing squads to at least 142. CAPTION: Picture, AYATOLLAH KHOMEINI . . . apparent effort to end discord