After three years of relative harmony, tensions are beginning to surface among some of the 2.8 million Afghan refugees and their Pakistani hosts along the border.

Disputes about land, water rights and deforestation have erupted in some of the 282 refugee camps in the Northwest Frontier province, occasionally leading to violent clashes between local residents and the Afghans, many of whom have weapons for use in their guerrilla war against Soviet occupation troops across the border.

Four refugee camps have been closed and their 35,000 occupants moved elsewhere because of one clash in which rampaging refugees attacked a Pakistani village, burning eight houses and killing one person.

Pakistani authorities vigorously deny the existence of any serious problem, and, indeed, considering the vast numbers of people involved and the dislocation of normal lives resulting from the massive migration of Afghans in such a short period of time, the number of serious incidents has been remarkably few.

But Afghan refugees and local Pakistani residents, in interviews across a broad stretch of the frontier province, said that the potential for widespread friction is present.

They believe that if massive assistance by the U.N. High Commissioner for Refugees and other international agencies were to diminish, serious trouble could erupt as a result.

Also, if job opportunities for Pakistani migrant workers in the Middle East diminish and they return home to compete with Afghan refugees for jobs, the tensions are likely to increase even more, these sources say.

Some leftist opponents of President Mohammed Zia ul-Haq's martial-law government have seized upon the issue, criticizing Zia for encouraging the influx of refugees and, as a result, unnecessarily antagonizing the Soviet Union. The fear of these critics is that since the Afghan rebels move freely across the border to conduct raids on Soviet positions in Afghanistan, carrying arms that are funneled through Pakistan, the Soviet Union's hostility toward Pakistan will increase proportionally as its losses mount.

Pakistan's official position toward the rebels is that it recognizes the various guerrilla political fronts headquartered here only for the purpose of registering refugees and settling disputes with local residents.

"We know they are involved in politics, but we do not recognize that activity," said Abdullah Khan, commissioner for refugees in the Northwest Frontier.

He denied persistent reports of guerrilla training in the refugee camps and said, "The Afghans are known for their skill with weapons. No one needs to teach them."

The most serious outbreak of violence between the refugees and local Pakistanis occurred in July in Haripur, where 250,000 Afghan refugees were concentrated in 20 camps.

U.N. officials said the trouble began with arguments at a local well between Afghan women and Pakistani women, and it escalated when someone announced over a loudspeaker atop a minaret of a refugee mosque that refugee women had been beaten by the locals.

Refugees with rifles attacked a nearby village, shot to death a young girl in a fusillade of gunfire and burned eight houses before Pakistani police intervened. Thirty persons were wounded.

Pakistani authorities moved four of the Haripur camps several miles to Ghazi in an effort to ease tensions, but refugees in the new camp complained bitterly this week that they are deliberately being subjected to harsh conditions as punishment for the attack.

They said that because no water pump has been furnished, they are unable even to build the mud walls that Afghan refugees invariably erect around their tents and makeshift huts for privacy. U.N. officials said they are attempting to provide the Ghazi camps with basic necessities until it is better established.

In the remote tribal areas close to the Afghan border there have been frequent reports of armed clashes between refugees and locals, often precipitated or, at least, exacerbated, by longstanding intertribal disputes.

In the more densely settled areas around this provincial capital, according to Pakistani officials, there have been 81 reported cases of disputes between locals and refugees, although officials of international voluntary agencies who work in the camps say the figure is much higher.

Most incidents, according to the volunteers, involve stone throwing arising over water rights, squatting on land, grazing by the 2 1/2 million livestock that have accompanied the refugees or cutting down of trees.

Pakistanis generally are reticent about talking about communal tension because of the collective pride the country has shown in providing a haven for a beleaguered Islamic neighbor and because criticizing the refugees is frowned upon. But privately, in interviews, Pakistanis of various walks of life expressed growing impatience and a fear that the tensions will increase as Afghans continue to arrive at a rate of 50,000 a month.

One Pakistani talked of some refugees who squatted in a graveyard, embittering relatives of the interred. "But how can they object, unless they are ready for a fight," he said.

A university professor said that when the refugees began ariving he thought the limit of endurance of Pakistanis in the province would be short.

"I'm glad I was wrong, but there still has to be a limit of endurance. We are seeing quite a few symptoms of patience running out," he said.

He added that while overall relations appear on the surface to be smooth, he is hearing with increasing frequency a number of minor grievances, such as neighbors going to the local meat market only to find that refugees have already been there and bought out the best cuts of meat.

"The saving grace has been the international agencies. But how long can they keep it up if their sources of funds begin to dry up?" he asked.

Some Pakistanis complained that leaders of the six rebel political organizations that maintain headquarters here--provided by the government -- are beginning to involve themselves in local affairs and even to offer commentary on the manner in which Zia is transforming Pakistan into a fervently Islamic, fundamentalist state. On at least one occasion, senior officials of Zia's government are said to have warned rebel leaders to stay out of Pakistani politics.

"We want an Islamic system, but we don't want anyone telling us how it should be," said one Pakistani journalist.

Even with enormous infusions of foreign money for refugee assistance -- $192 million from the U.N. High Commissioner for Refugees alone -- the Pakistani government maintains that the influx has caused a severe strain on the national budget and that increases in direct assistance by contributing nations will be needed as the refugee population grows even larger.

Vehemently denying persistent reports of widespread corruption in its refugee program, the government says its direct cost this year will be $240 million -- a significant amount for a country with a froeing exchange shortfall of $1 billion.

Col. A.M. Barbar, minister of state for the frontier region, said that Pakistan's rail system has been strained to the limit by the 32,000 metric tons of wheat that arrives each month at Karachi and has to be transported to the refugee camps.

He said that in addition to more assistance for inland transportation, Pakistan needs help in reforestation, construction of roads to refugee camps and the purchase of medical equipment.

Although more than 9,000 Pakistanis are employed in the refugee program, they are barely evident at the camp level, where each camp of about 10,000 refugees is supposed to have -- but often lacks -- an administrator and 20 assistants. At the Mera Barakai camp, the largest in the Northwest Frontier, officials said each of six refugee villages of 10,000 people was administered by eight staff members.

Refugees complained that there are often long delays in the distribution of their monthly allowance of 50 rupees (about $4.35) per person. In addition, the office of the U.N. high commissioner oversees the distribution of wheat and other staples contributed by the World Food Program.

Mohammed Gullab, a 23-year-old spice shop owner in Mera Barakai who said he spent eight months fighting in Afghanistan last year, said that when he is working he can make an additional 70 rupees (about $6.10) a month. But he added that he regularly contributes part of his earnings to the guerrilla organization.

Gullab said that when he is in the camp, his father goes across the border to fight with the guerrillas.

"We hunger for Afghanistan more than we hunger for food," he said.

Nearby in the Mera Barakai bazzar, a vegetable seller said he makes 25 rupees (about $2.20) a month but also contributes some to the guerrillas.

"For us, what is important is the jihad holy war . Pakistan is an Islamic nation, and we are happy here. But we will only really be happy when we return to Afghanistan," he said.