The assassination of President Anwar Sadat by a group led by a young Army lieutenant said by the government to have been "blinded by black hatred" over the arrest last month of his brother, a Moslem extremist, has suddenly focused attention here on the possibility that Islamic fundamentalism has become a current inside the nation's most important institution, the Army.

Official anxiety over the issue was underlined today when the Army dismissed 18 officers because of suspicion of extremist religious beliefs. Like the killing, this dismissal suggests that many here fear that Egypt could be heading into a national crisis of identity whose most important manifestation in recent years has been the widespread revival of militant Islamic fundamentalism.

Sadat himself may have failed to appreciate the seriousness of a crisis that had increasingly been tearing away at the fabric of Egyptian society while he was playing world statesman. Clearly believing himself to be perceived nationally and internationally as a pious Moslem, Sadat acted as if he were immune to the challenge of the fundamentalists. In that, like his late friend the shah of Iran before him, he grossly underestimated the magnitude of the social dissatisfaction stirring his subjects and the ability of religious zealots to exploit it.

Ironically, Sadat, more than most Egyptian leaders, was hardly unfamiliar with the seductiveness, thoughts, organizational ability and propensity for violence of Moslem extremists in Egypt. He had once been closely associated with them and in recent years had sought to use them to shore up his own political base.

In recent decades, the Army has played a predominant role in providing political leadership for Egypt. It produced the "Free Officers" movement, including Sadat and Gamal Abdel Nasser, that overthrew King Farouk. It shaped Nasser and Sadat and now President-designate Hosni Mubarak and provided all three with a strong base of support among the officer class.

The apparent connections between the assassins, who were active and reserve members of the Army, and the extremist Islamic sect that killed Sadat are the first suggestion that the Army might contain a significant strain that is at odds with the Nasser-Sadat-Mubarak line of leadership.

While the Army has given no indication of such factionalism in the past, Islamic fundamentalism in Egypt is not a new and unknown phenomenon. It predates the 1979 revolution against the shah in Iran by 50 years, having begun in 1929 with the formation of an organization called the Moslem Brotherhood under the guidance of a school teacher, Hassan Banna.

Like the newer Islamic fundamentalist movements, the Moslem Brotherhood sprang to life as a virulent Islamic reaction to the corrupting Western influences in Egypt, then ruled by Britain. The Moslems feared that the attractions of Western technology, science and consumerism were rapidly breaking down the old Islamic social order.

By the time the decadent Egyptian monarchy of King Farouk was overthrown in 1952, the Moslem Brotherhood was a political force to be reckoned with in Egypt.

Political terrorism was Hassan Banna's most lasting legacy to Moslem fundamentalism. Coldly interpreting the Koran, the Moslem holy book, Banna developed a theory that the killing of traitors of Islam was not only sanctioned by Allah but necessary to purge Islamic society of its corrupters of values.

While most Moslem Brothers adhered to the movement for its defense of Islamic values, Banna developed a network of Brotherhood "secret societies" armed and trained to confront Islam's political enemies, probably the area's first true terrorist organization.

By the time of the 1952 coup, the Moslem Brotherhood's secret societies had claimed the assassination of two postwar prime ministers, a national police chief, countless judges, politicians and lesser officials considered either religious backsliders or Egyptians mesmerized and corrupted by the West's un-Islamic values.

Sadat was close to the Moslem Brotherhood immediately before and after the 1952 coup. He is believed by many Egyptians to have been a member of the secret Brotherhood at the time but in his autobiography he says he was just a liaison member to the Free Officers movement. Certainly he knew Banna well before Banna's assassination in 1948 and worked closely with the Brotherhood into the early 1950s.

The relationship ended after the Brotherhood turned against the Free Officers because of Nasser's espousal of a secular Arab socialism that only paid lip service to Islam. In 1954 a Brotherhood gunman tried to assassinate Nasser, firing eight bullets -- all of which missed -- as he delivered a speech in Alexandria.

The attempt led to a harsh repression of the Brotherhood by Nasser. Eight leaders were executed and 800 others imprisoned. The result was enmity between the Brotherhood and the Free Officers who, until Sadat's death, had dominated the Egyptian government since 1952.

Moslem fundamentalism dies hard. As it had survived the social experiments with European democratic liberalism in the first half of this century, it survived Nasser's strongarm efforts to impose his secular brand of Arab national socialism in Egypt.

The failure of Nasser's nationalist experiments was, Egyptian scholars of the period agree, confirmed by his defeat by Israel in the 1967 war, which humiliated Egypt and its messianic leader. Until his death in 1970, Nasser never recovered, nor did the force of his ambitious ideology.

Egyptian scholars place the beginning of the resurgence of Islamic fundmentalism with Egypt's defeat in 1967, which the fundamentalists exploited by saying it was a punishment of Egypt for its abandonment of God. With both liberal democracy and Arab socialism discredited by their failures in the past, Islam reemerged as the only workable alternative social force to hold Egyptians together.

Sadat tried to use such a force to his advantage. He freed many Moslem Brothers from jail after he became president on Nasser's death. More significantly he allowed thousands of militant "Islamic societies" to be established in universities, schools and factories, to counter the atheist Marxist groups that had flowered around the country under Nasser.

With the benefit of hindsight, some Egyptians are now asking whether Sadat neglected -- or failed to understand -- that Banna's violent legacy was quickly embraced by the more militant of the new fundamentalist groups that, while respecting the traditions of the old Brotherhood, soon deemed it too moderate and reformist for their fanaticism.

These groups, the most prominent of which is the martially trained Takfir wa Hijra (Repentance and Flight From Sin) with which Sadat's killers have been linked, organized around the country in secret cells, most of which have mixed religious meditation with secret desert retreats to study armed struggle and political terrorism.

"The irony," said an Egyptian professor at Cairo University here who asked to remain anonymous, "is that it was Sadat himself, for his own political reasons, who gave the fundamentalists the encouragement and freedom that made them a force that would actually kill him."

To Egypt's fundamentalists, as to other Arabs around the Middle East who quickly denounced him, Sadat's peace with Israel was a betrayal of Egypt's Arabism and its traditional roots in Islam, giving organizations such as Takfir wa Hijra a strong new reason to oppose him.