Saudi Arabian troops mounted a major assault on the Great Mosque of Mecca last night and evidently succeeded in taking control of it from the remaining radical Islamic gunmen who seized it Tuesday, diplomatic sources said.

Witnesses in Mecca, whose reports were relayed by the diplomatic sources, said they heard explosions at the mosque and saw smoke and fire coming out of it as the assault began.

There was no immediate information on casualties in the attack. Nor was it known how many troops were involved or what weapons were used.

However, the witnesses reported that quiet later returned to Islam's holiest shrine, and that Saudi soldiers could be seen standing casually on the roof instead of running or crouching.

This gave observers the impression that the remaining band of Moslem extremists occupying parts of the mosque had been overrun.

There were unconfirmed reports early today that some of the gunmen had escaped and were at large in Mecca, the birthplace and focal point of the Islamic religion.

[The Associated Press reported from Riyadh that casualties were believed to have been heavy, but gave no estimates.]

The Saudi government did not immediately issue any official statement on the mosque assault.

The decision to attack reversed an earlier decision to try to wait out the gunmen risking the lives of the remaining hostages in an assault.

Diplomatic sources said the gunmen apparently had more weapons, ammunition and food and the ability to hold out longer than the Saudi authorities originally thought.

In addition, the sources said, the Saudi National Guard, which already had succeeded in regaining control of most of the mosque, evidently was taking more casualties than expected in trying to oust the last diehards.

The attack evidently coincided with a religious decree issued last night in which leading Saudi clergymen paved the way for the action by saying the gunmen had violated the sanctity of the Great Mosque in an abhorrent way and that they must be fought.

Prior to the attack, knowledgeable sources said the gunmen who occupied the mosque were seeking reversal of Saudi Arabia's modernization and the abolition of television, professional soccer and employment of women outside the home.

Disclosure of their goals indicated for the first time that their opposition to the Saudi leadership was political as well as religious. But while these concerns are shared by many Saudis, there was no open show of support for the gunmen or their tiny minority sect.

The attackers' reported goals were not part of an organized platform, the sources said, but rather became known through the gunmen's conversations with hostages, since released and questioned by Saudi authorities.Their anti-Western theme seemed to fit into the current of Islamic fundamentalism sweeping across much of the Middle East since the Shiite Moslem revolution in Iran and proclamation of an Islamic republic there based on conservative Koranic principles.

The demands also reflected the unsettling effects of the gigantic development effort undertaken by this desert kingdom, which is spending $142 billion in its five-year development plan on everything from oil refineries to chicken farms. The breakneck pace of this economic growth and the accompanying influx of foreign influence have jolted the Islamic-based monarchy, creating concern among some members of the royal family that their people's traditional Moslem values are eroding.

The occupation of the mosque seemed likely to strengthen the argument of those who have been urging a slowdown in the modernization program and more attention to reconciling it with Saudi traditions grounded in orthodox Islam and the Bedouin desert code.

The Mecca occupation, clearly had upset the kingdom's rulers. U.S. Treasury Secretary G. William Miller, here for three days of economic discussions, said he found King Khalid preoccupied with it during a brief courtesy call on the monarch this evening. Crown Prince Fahd, the first deputy prime minister who effectively runs the kingdom, canceled a meeting with Miller because the prince was in Jeddah directing efforts to capture the remaining mosque invaders.

This represented a setback for Miller. Fahd is the key decision-maker on the subjects that brought the secretary here: oil prices, the level of Saudi oil production and Saudi cooperation in steps to keep the U.S. dollar strong on world monetary markets.

Miller said, however, that he discussed those subjects and others fruitfully with Saudi Finance Minister Mohammed Aba Khail.

In his talks, Miller said, Saudi officals reiterated their concern that oil companies are increasing their profits while Saudi Arabia and some oil-producing countries are trying to hold the line on oil prices. The Saudis, Miller said, warned that if Congress does not cut back American oil company profits, there could be a new round of price increases.

In a way, Miller's concerns also underscored the extent to which Saudi Arabia's massive wealth -- income this year is forecast at $60 billion -- is catapulting the entire society into the complications of the modern world. The gunmen's mention of television, football and women at work only pinpointed areas where imported Western ways are most visible to common people.

Reflecting the sensitive questions raised by the takeover, the government maintained its silence on efforts to retake the mosque. It has organized special charter flights, barring American and British flight crews, to ferry remaining foreign pilgrims out of the kingdom ahead of schedule in an apparent effort to prevent them from recounting what they went through, airline crewmen said.

Despite these precautions, some information had filtered out Military sources, revealing the scope of the fighting said Saudi National Guardsmen blew up the mosque gates on Wednesday and fought their way inside, resulting in the death of the unit commander who led the charge.

Prince Sultan, the defense minister, ordered a halt to the attack when guardsmen saw that the invading gunmen were well armed and had taken up sniping positions in minarets.

Since then, the security forces had been moving with extrme caution despite firepower that includes heavy weapons and about 30 personnel carriers flown to Mecca in U.S.-supplied C130 transport planes, the sources said.

Casualty estimates have ranged from 50 to 200, including some Saudi National Guardsmen.

Sheik Mohammed Bin Sebil, an imam or chief priest at the Mecca mosque, told the Riyadh newspaper Al Gezirah that one guard was killed and two were seriously wounded in the initial takeover during dawn prayers Tuesday.

In the first such interview published by the government-controlled Saudi press, Sheik Sebil said the gunmen had sneaked in among the praying thousands and then began shooting into the air with submachine guns, rifles and pistols. They closed doors leading out of the mosque courtyard, he said, and presented one of their number as the mahdi, or enlightened one awaited as a final prophet by one segment of fundamentalist Moslems.

"I noticed that their faces were not unknown to us," he said. "They are from among religious extremists."

This coincided with reports that the gang's leaders had been involved in earlier agitation and had been arrested or put under police supervision.

Observers recalled that Saudi television particularly had been the object of demonstrations by religious extremists in the past. The assassin who killed King Faisal in March 1975 was said by Saudi investigators to have acted because he was seeking to avenge a relative killed during efforts to put down a protest against a television station.

Yesterday Saudi Information Minister Mohammed Abdu Yamani denied a Soviet report that U.S. troops disguised as oil workers had landed in the Persian Gulf port of Dhahran.

The minister was quoted by the Saudi press agency as saying the Tass report was a "shamefully fabricated provocation."