ANSAR, Lebanon (AP) _ The Israeli army freed more than 750 prisoners in southern Lebanon on Wednesday and many of the released men chanted ''Khomeini, Khomeini'' and shouted defiance of the Israeli occupiers.

With its withdrawal from Lebanon only weeks away, the Israelis closed the Ansar prison camp, freed the prisoners and sent a fleet of trucks to dismantle other military positions.

The prisoners - many of them Shiite Moslems who espouse the teachings of Iranian leader Ayatollah Ruhollah Khomeini - chanted ''God is great. War until victory. Khomeini, Khomeini'' as they sat in Israeli army trucks that took them from Ansar to the Lebanese villages where they were freed.

Some had their hands tied in front of them with strips of white plastic, but the rest clapped and made V for victory signs with their fingers.

''We love Khomeini. He knows everything,'' a 20-year-old Shiite said. The young prisoner identified himself only as Jihad, an Arabic word that means ''holy war.''

On Tuesday, the Israelis took 1,100 other Ansar prisoners to a new detention center in Israel. The release of about a third of the prisoners was designed to ease tensions with southern Lebanon's increasingly hostile Shiite Moslems.

About 20 staffers of the International Red Cross monitored the release. Michel Cagneaux, head of the relief agency's Tel Aviv office, said the unofficial count showed 758 prisoners were released. But Yossi, the camp commander, put the figure at 752.

Defense Minister Yitzhak Rabin indicated release of the other prisoners would be linked to an end to the guerrilla warfare that has claimed the lives of 40 Israeli soldiers so far this year.

But at the same time, the Israelis conducted another of their ''iron fist'' raids on Shiite villages suspected of harboring guerrillas. Israeli soldiers searched houses and shops in Teir Zebna and rounded up 300 men for questioning, United Nations spokesman Timur Goksel said.

About 75 percent of the Ansar prisoners were Shiite Moslems, according the camp commander, who in accordance with Israeli military regulations was identified only as Col. Yossi. He said the rest were Palestinians or Lebanese Sunni Moslems.

Some of the prisoners freed Wednesday said they had been at Ansar for nearly 17 months - since November 1983 when Israel carried out its last mass release of prisoners.

Yossi said he had seen an increase in Shiite fundamentalism among the inmates.

''In the beginning, the numbers praying were very small, but during their detention that number grew and grew,'' the colonel said. ''I cannot say if they are more radical. We'll only know in a few months.''

Imprisonment in Ansar also appeared to have forged new bonds between Shiites and Palestinians, who had fought each other before Israel invaded Lebanon on June 6, 1982 and destroyed the Palestine Liberation Organization's tight hold on southern Lebanon.

''We are all brothers. I am a member of the PLO,'' said Nader Mohammed, a 27-year-old Palestinian born in the Gaza Strip, which Israel captured from Egypt in the 1967 Arab-Israeli war.

A 19-year-old Israeli soldier, who gave his name only as Eyal, had been stationed at Ansar. He said he was sorry the prisoners were freed. ''People worked very hard to bring them here. They are not innocent people, and in a few days time ... we may have trouble all over again,'' he said. He refused to give his last name in keeping with military regulations.

The transfer of about 1,100 other Ansar prisoners to Israel on Tuesday spurred an unusual public protest from the Red Cross. It said moving civilian detainees across an international border was a violation of the Geneva Conventions.

An Israeli Foreign Ministry spokesman, speaking on condition he not be identified, said his office had no immediate comment on the Red Cross statement. However, Israel has long maintained that the Geneva Conventions do not apply to prisoners arrested in Lebanon since there has been no declaration of war between the two nations.

According to senior Israeli military and political leaders, the withdrawal from Lebanon will be finished by late May or June. Originally planned for completion by September, the pullout has been speeded up as attacks on Israeli soldiers escalated.