As rioting spread through the Northern Irish city of Portadown last week, a group of angry Protestant housewives, several pushing strollers with infants, found themselves blocked from the city center by a line of police in full riot gear.

"They'll pay for this," said one woman to another as the group was turned away. "They think they're safe with us, safe in their houses. No more." Reaching into their purses, the women pulled out handfuls of pennies. They shouted "Judas" as they hurled the coins at the flak-jacketed chests of the expressionless officers of the Royal Ulster Constabulary.

The mainly Protestant RUC long has been considered by the majority Protestant community as "their" police force. Now, for many, it has become the enemy.

In the eight days since the Portadown riot, enraged Protestants have thrown much more dangerous projectiles at RUC officers. One hundred forty Protestant attacks against policemen or their families have been reported, including personal assaults and homes pelted with rocks or set ablaze with firebombs.

At least 18 police families have been forced to move, including two who saw their houses burned to the ground. One reserve officer has been shot and wounded.

In a statement to Parliament today, Prime Minister Margaret Thatcher said she was "appalled" at the violence against police. In a separate statement, Northern Ireland Secretary Tom King condemned "these cowardly and disgraceful acts . . . of terrorism." King said that new housing was being found for police and that extra patrols were being mounted to catch the perpetrators of the violence.

The cause of Protestant rage is the Anglo-Irish agreement signed last November between Dublin and London that gives the Irish Republic a voice in the north on behalf of the minority Catholic community. By defending and implementing the agreement, the RUC is perceived by hard-line Protestants as turning against them.

The question for the British government, as the province enters what is certain to be a long summer of violence, is whether the RUC will remain loyal in the face of what King acknowledged in a weekend television interview is an "intolerable" strain.

Should it crack, Britain now has at least 10,500 Army troops in the province to move into the breach. But to use them, the British have implied, would be to admit a defeat in a drive whose ultimate goal is to establish stability in Northern Ireland.

Speaking today to Parliament, King said the Army would provide any support that the RUC needs. But with as much anxious hope as promise, he pledged that the police force would stand firm. "They have stood bravely for 17 years," King said, "and they're not going to stop now just because the terrorism comes from a different quarter."

The RUC traditionally has been able to turn its back on one portion of the community to fight against the other. During 17 years of violence in Northern Ireland, Protestants have seen the police as their bulwark against the murderous tactics of the outlawed Irish Republican Army -- the self-appointed vigilantes of the Catholic minority.

At least 200 RUC officers have been killed during that period, nearly all in IRA attacks.

Even more than trusty defenders, however, the police have been an integral part of the Protestant community from the establishment of the province in 1922. Of the RUC's 13,000 regular officers and reservists, at least 90 percent are Protestant. Whether out of hopelessness, hatred or fear of IRA retaliation, Catholics have been reluctant to join.

Under a system of self-imposed sectarian segregation, most RUC officers live in Protestant areas -- easy targets for their neighbors.

In a Belfast news conference yesterday, Chief Constable John Hermon denied suggestions by Protestant leaders that the violence against police has been a "spontaneous" expression of popular opposition to the agreement.

"I am satisfied that there is a very sinister hand behind it all," said Hermon. "It is being orchestrated by subversives and paramilitaries on the loyalist side." Loyalists, or Unionists, are politically active Protestants who oppose any change in Great Britain's relationship with Northern Ireland. They particularly oppose the Anglo-Irish accord.

Some Unionist leaders are convinced that no good can come of the antipolice violence, and have tried to distance themselves from it. James Molyneaux, leader of the Official Unionist Party, said he had a duty to warn genuine loyalists not to let themselves be used by extremists. "They will reduce Ulster to anarchy and ruin," he said.

But the sight of police shooting back at Protestants in Portadown was troubling even to relative moderates in the Unionist camp. The RUC fired a nearly unprecedented total of 148 rounds of plastic bullets into the Portadown crowds. One 20-year-old man, apparently hit in the neck, is still in a coma.

These are the events of which martyrs long have been made in the Catholic community. There is little doubt that they now will do the same for the Protestants. Unionist paramilitary groups such as the legal Ulster Defense Association and the illegal Ulster Volunteer Force say their recruitment has increased dramatically since the agreement.

In the current Northern Ireland climate, the voices of Protestant moderation are growing faint. Some politicians have argued that there still are legal means with which to pressure Thatcher into abrogating the agreement. In private, some have suggested quietly suspending meetings of the joint Anglo-Irish conference it established, at least until tensions ease.

But even if Thatcher could persuade the Unionists to accept a de facto suspension, there is little likelihood the accord's other signatory, the Republic of Ireland, would agree. A senior Irish official, contacted by telephone in Dublin, acknowledged that his government is "worried" about attacks against the police. But suspending the accord, he said, would only convince the Catholics that they once again had lost out to Unionist pressure.