A senior Pakistani government official today questioned the need for the United States to evacuate all families of embassy personnel and nonessential diplomats after the burning of the U.S. Embassy here Wednesday by a mob of Pakistanis.

He also promised increased protection for diplomatic personnel in the future and said Pakistan would pay for reconstruction of the $21 million complex of embassy buildings.

"I would say it is a slight overreaction," Maj. Gen. Mujibur Rahman Khan, information secretary in Pakistan's Army-run martial law government, said of the U.S. evacuation.

"The feeling in the country is that everything has been brought under control, the government has taken action, then why evacuate people?" he said.

Khan said that Pakistan now has arrayed enough Army troops around the diplomatic missions here to make sure there could be no repetitin of the sacking of the U.S. Embassy -- in which two Americans died and 90 persons barely escaped being burned alive after taking refuge in a small code room for about five hours while fire roared around them.

Asked if that would include protection from demonstrations that might erupt in the case of U.S. military action to free hostages held in the U.S. eEmbassy in Iran, Khan said: "Once bitten twice shy. The Pakistan government is not going to allow anything to happen to foreign nationals in Pakistan."

Moreover, he revealed that the government of Gen. Muhammed Zia ul-Haq has acknowledged its responsibility under international law and promised to pay to rebuild the embassy here, opened in 1973.

Diplomats here from all areas of the world and of different political views continue to insist that the government failed to mobilize the needed force to chase the mob from the U.S. Embassy grounds before all the buildings in the 32-acre compound were destroyed completely by fire.

Officially the U.S. position is that Zia's government rescued those trapped in the embassy, the version pushed by papers here and by Khan today.

But the 90 persons who were trapped in the burning building insist they escaped on their own when it became too hot for them to remain inside the 20-by-30-foot steel-walled code room. That heat is also believed to have driven the mob off the roof.

"The ambassador kept telling us to hang in, that help was on the way. But it never came. That room just got hotter and hotter. We got ourselves out in the end," said one embassy employe who was trapped in the building.

Added a diplomat here who watched the attack on the U.S. mission from a nearby building, "It wasn't the military that saved them. It was the sunset."

Giving for the first time a detailed account of the Pakistan government's version of what happened at the U.S. Embassy Wednesday, Khan addmitted that the government was caught by surprise by the mob violence against U.S. facilities here and in other parts of Pakistan.

"Nobody really felt there would be a reaction like this against a particular mission. If that had been realized, of course strong security measures could have been taken," Khan said.

Compounding the problem, Khan said, was President Zia's tour of markets in nearby Rawalpindi, which drew hundreds of thousands of people and held the attention of this area's top law enforcement and military security people. The area's martial law chief, who have the authority to call in the Army quickly, was occupied with the president on Wednesday.

Nonetheless, Khan insisted that Pakistan had done everything possible, despite the four hours that elapsed before a response came to continual pleas for help from U.S. officials.

He acknowledged that the initial police response was overwhelmed by the mob, but said those officers fired 87 rounds at the invaders, killing two of them. Khan backed statements by the U.S. Embassy here that no U.S. marines had fired on the mob.

"There was no deliberate delay by anyone," said Khan. "If the reaction time was slow, according to the Americans, it could be due to some lack of communication."

He said that had the Army rushed in early and killed 50 or 100 Pakistanis, "no embassy would have been safe. If indiscriminate force had been used with large-scale killing, the country might have been on fire. The burning of foreign posts might have spread all over, and no force could have protected anybody."

Khan said the spark that incited the violence was the invasion of the holiest Moslem religious site, the Great Mosque in Mecca. The first radio reports gave no identification of the invaders, but rumors swirled through this country that they were non-Moslems.

"What happened in Mecca," said Khan, "is something which had never happened in the last 1,400 years, a situation that left Moslems all over the world deeply shocked with anguish. It was so unusual that the reaction of the people was beyond any comprenhension."