In a dramatic 11th-hour gesture tonight, a papal envoy flew here and met with IraY hunger-striker Bobby Sands for an hour in the heavily guarded Maze Prison.

The Rev. John Magee, who arrived from London after a brief meeting with a British Foreign Office official, immediately went to the prison, south of Belfast, where Sands is in the 59th day of hunger strike demanding that the British government grant IRA inmates political-prisoner status.

British officials reasserted today that they will not concede the issue of political status. They have maintained throughout the crisis that Sands and the other IRA prisoners are criminals convicted of terrorist crimes rather than political offenses.

Tensions, which remained high throughout the province after a soldier of the predominantly Protestant Ulster Denfense Regiment was killed in a terrorist ambush today, heightened further as the announcement of the envoy's visit drew denunciations from hard-line Protestant politicians. Thousands of Protestant militants marched in Belfast tonight in an unarmed show of strength.

Scattered violence continued in Catholic areas of Belfast with youths hurling stones and gasoline bombs at security patrols. No injuries were reported. The IRA has threatened a major eruption of violence should Sands die and Protestant militants have been preparing to respond in kind.

Sands was reported to have received last rites for the second time.

Magee, who is the Pope John Paul II's private secretary and who is from Northern Ireland, spent four hours in the prison where hundreds of IRA men are held. He reportedly met Sands along with members of Sands' family and local priests from the public housing estate where the Sands family lives. No further details were available on the envoy's visit.

"I am on a mission of mercy," Magee said his arrival here tonight. Asked if he would be appealing to Sands to end his hunder strike, Magee replied, "That will come up." British officials described his trip as an expression of "humanitarian" concern by the pontiff.

The pope has taken a risk in entering the sectarian waters of Ulster when they are close to boiling, and there was fear tonight that if Magee fails to end Sand's hunger strike the pope's planned trip to Britain next year could be affected.

John Paul visited Ireland 18 months ago and issued an appeal to all "men of violence" to stop the killing in Ulster. More than 2,000 people have died in 11 years of violence in the strife-wracked province.

Sources with IRA connections claimed today that Sands had been moved to a water bed to better support his body, which has shrunk by about 60 pounds since he began taking only salt and water on March 1. The sources also said Sands was losing his hearing, eyesight and ability to speak. A British Northern Ireland Office official in Belfast today said only that the 27-year-old guerrilla's condition "continues to deteriorate."

Peter Robinson, a British member of Parliament and member of the Protestant Democratic Unionist party in Ulster headed by the Rev. Ian Paisley, said tonight, "The pope has now joined the IRA's propaganda team by sending his private secretary to Northern Ireland. If the pope at this late stage wants to act in a helpful way, let him excommunicate murderers and gunmen who enjoy membership of his church."

Six part-time soldiers have been killed in IRA attacks this year and seven people have died in the 2 1/2 weeks since Sands was elected to the British Parliament in a special election against a Protestant opponent.

The demands that Sands and three other IRA hunger-strikers not yet in critical condition are pressing include a relaxation in prison rules to permit them to wear civilian clothing, choose their own prison work, freely associate with each other, have outside visitors and receive additional outside letters and parcels.

Today the hard-line Paisley demanded that more British troops be brought to the province, but Northern Ireland Secretary Humphrey Atkins turned him down.

After his meeting with Atkins, Paisley threatened that Protestants might set up "vigilante groups" to protect themselves. His threats underscored worry among British officials that the vast majority of peaceful Ulster residents could be caught between extremists on both sides.

One victim of the recent rioting by Catholic teen-agers was 15-year-old Paul Witters, who was buried in Londonderry today. He died from a brain injury after being hit by a plastic bullet fired by British security forces when Catholic youths rioted 10 days ago.

The Rev. Frank McLauthlin conducted the funeral service for Witters in St. Columbia's church in the middle of the Catholic working class ghetto in Londonderry. Speaking to a full congregation of about 400 including many young teen-agers he said, in a pleading voice, "I appeal to the young people of Derry. Paul was one of you. Do not be used." He then appealed to the young Catholics of the province's second-largest city not to riot in response to Withers' death as many had after the funerals of two other youths killed in clashes with troops.