They were roommates first in New York's Greenwich Village, where both studied in the 1960s, and then in Qanatar prison near Cairo, where they were incarcerated by President Anwar Sadat in 1981.

But while coincidence has pulled them together, their ideals have pushed them apart.

Safinaz Qazim, a Moslem fundamentalist who supports the establishment of an Islamic government in Egypt modeled on Iran, and Nawal Saadawi, a fierce proponent of secularism and women's liberation, represent the extremes of two strains in Egyptian political life.

As Egyptians, they are participants in a mounting political and social struggle over the essential character of Egyptian society. As women, they are proponents of opposing views of the woman's role in that society.

The struggle, which now centers on a fundamentalist demand on the government to implement strict Islamic law, has caused much debate in the press, political circles, courts and mosques.

Though the government is winning the majority of battles -- it arrested fundamentalist leader Sheik Hafez Salama earlier this month -- most liberals concede that the fundamentalists are now winning the war.

"If you were to take a vote tomorrow on Salama's version of Islamic law, yes, the majority of people would vote for it," said one respected Moslem liberal during a recent interview.

Yet the primary concern for both liberals and fundamentalists extends beyond implementing strict Islamic law, called sharia.

"More dangerous than the concept of applying sharia," said sociologist Sayed Yaseen, "is that they want to establish a closed Islamic society in which the private sphere is controlled by public authorities."

Safinaz Qazim is representative of such thinking.

"You can't construct a secular body and put an Islamic badge on it," says Qazim, who wears a dress reaching her ankles and a veil that conceals her hair and neck.

"What concerns us is the establishment of an Islamic state in Egypt -- not merely sharia -- but an Islamic state which governs 24 hours of our life."

Just a few blocks from Qazim's apartment, which is located in a relatively poor neighborhood of Cairo, is the mosque where on July 14, Sheik Salama worked a crowd of about 3,000 worshipers into a fever pitch before calling off a planned protest march to the presidential palace.

Inside Qazim's modest apartment, pictures of Ayatollah Ruhollah Khomeini and Khaled al-Islambuli, the leader of Sadat's assassination, are displayed alongside a smiling graduation picture from New York University.

Qazim says her nationality is Islam, which governs every act of her life. When she enters a room, she should utter a certain Islamic phrase; when she sneezes, there is another.

Qazim thinks that Christians as well as Moslems should be required to veil all but the face, hands and feet, and that the woman's primary role should be in the house.

Qazim said a woman like Saadawi would face an Islamic court in the society Qazim envisions.

"As an infidel, if she expresses her views, she will be tried and given a chance to repent," said Qazim. "If she insists on opposing Islam, she should be killed."

Qazim had not yet embraced fundamentalism when she and Saadawi lived together for three months in 1965. They saw films, went to the theater and sometimes discussed the role of women in society.

Saadawi was studying at Columbia to become a psychiatrist, and Qazim at NYU in preparation for a career as a drama critic.

In prison, 16 years later, they met again. Along with about 35 women and 1,500 men, they were swept up in a dragnet by Egyptian security forces in September 1981. The overnight crackdown occurred just two months prior to Sadat's assassination by Moslem extremists.

Qazim, the fundamentalist, and Saadawi, the women's rights advocate, were the first two women released by the new president, Hosni Mubarak, and they walked from the prison arm in arm. But they have seen little of each other since.

Saadawi's apartment is in a more affluent neighborhood than Qazim's. Inside, Bedouin rugs cover the floors and Arabic books line the shelves, yet the atmosphere suggests she is comfortable in a western setting.

Books like "Our Bodies, Ourselves" and "Selected Works of Lenin" compete for space on the shelves with a wealth of electronic equipment: stereos, tape recorders, a large television and a videocassette machine.

Saadawi has written several books on women's issues and is now the elected president of the 125-member Arab Women's Solidarity Association, one of several small groups lobbying for women's rights.

Recently, these women's groups gained what they called a partial victory when the government passed a law in early July recognizing certain basic rights for women.

The law gives a woman the right to request divorce on the basis of her husband's second marriage, but allows the judge to decide whether polygamy has harmed the first wife. A more liberal law, enacted by Sadat in 1979 and repealed several months ago, declared that polygamy was legally harmful to a first wife and automatically gave her the right to divorce her husband.

"Who is the judge to decide?" said Saadawi. "It's the woman who decides whether she has been harmed or not."

Some of Saadawi's views, considered blasphemous by fundamentalists like Qazim, are disavowed even by liberals as being "too western." Most liberals here -- men and women -- argue for their rights within an Islamic framework.

But Saadawi argues that Islam, though it has an enlightened interpretation, has no place in either politics or law.

In this belief, Saadawi is one voice among millions.

"The issue is not Islam versus anti-Islam," explains Cairo University Prof. Ali Hilal Dessouki, "but one of medieval versus modern Islamic thinking."

Though Saadawi concedes that fundamentalism is gaining adherents in Egypt, she does not expect to be wearing a veil or sitting before one of Qazim's courts in the near future.

She says confidently, "Egypt is not Iran."