KESHEM VALLEY, AFGHANISTAN -- In the wide valleys of the northern Hindu Kush mountains, local residents can remember what happened when Afghans began fighting their Marxist government in 1978 and 1979. Central government authority collapsed and innumerable rebel bands sprang up, battling each other as well as the communists.

"In some areas, it was just banditry," said Mohammed Es'Haq, an Afghan resistance party official with an extensive knowledge of the northeast region of this country. "Some local commanders were bullying, extorting money, settling personal scores and even killing people," he said.

After years of anarchy in much of northeastern Afghanistan, leaders of the guerrilla movement fighting the Soviet-backed government are establishing a civil administration in the region to support what they still say, despite talk of a negotiated settlement, will be a protracted war against the Soviet and Afghan government armies.

During a two-month visit to the area dominated by a growing resistance coalition known as the Supervisory Council of the North, this reporter observed indications that the council's emerging administration is winning popular acceptance. It appeared that the new administration -- accompanied by a shift of political power into the hands of young, modernizing, Islamic fundamentalist leaders -- could grow to have a significant impact on the postwar shape of large parts of this devastated country.

The council is a regional alliance of local resistance commanders belonging to the Jamiat-i-Islami, one of the seven Afghan resistance parties. Led by guerrilla commander and strategist Ahmed Shah Massoud, the council has expanded its activities into civil fields that council leaders say they now view as inseparable from the purely military aspects of the war and as unique, in the Afghan context, in terms of its geographical reach and political cohesion.

Foreign observers who have visited the north regularly -- including scholars, journalists and aid workers -- have noted that the council has spread its administration across most of six northeastern provinces in the past two years. Interviews with mujaheddin, or Moslem "holy warriors," and civilians in the region made clear that the most popular change under the council's system has been the restoration of law and order under an Islamic judicial system.

The council also administers a rudimentary but growing network of schools and clinics, and is planning economic development and social projects.

During the eight years since Soviet troops entered Afghanistan to prop up a crumbling, indigenous communist regime, the fiercely independent and often competing Afghans have worked to unify what has been a fractious resistance movement. The Supervisory Council of the North is, geographically, Afghanistan's largest rebel coalition. And, while its administration is highly decentralized, it is politically the most cohesive.

"It's the only real political organization in {guerrilla-controlled} Afghanistan now," said a western diplomat in Pakistan who has monitored the conflict for more than three years. The diplomat emphasized that most other efforts to organize and administer guerrilla-held areas were limited by tribal boundaries.

Northern Afghanistan is populated by ethnic Tajik and Uzbek minorities, whose nontribal societies have proven easier to unify than the Pathan tribes of southern Afghanistan that make up the country's largest ethnic group. While open clashes among Afghan guerrilla groups have decreased over the years as the anti-Soviet war has intensified, moves to actual unity have been frustrated in most parts of the country, notably by Pathan tribalism.

Residents in villages recalled the collapse of government authority in 1978 and 1979, after militant Marxists took power in a coup and began forcing radical reforms on this traditional-minded country. The communist program sparked an uprising that destroyed government authority in rural areas and led to the Soviet intervention.

Villagers interviewed in the northeast said the collapse of government authority and a proliferation of local insurgent groups brought anarchy and petty warlords proliferated. "The north was totally undisciplined and the {Kabul} government was taking advantage of the situation," said Abdul Mahbood, a senior Jamiat official from southern Badakhshan Province.

Local villagers and officials said the Supervisory Council of the North has subjected local resistance commanders to higher authority and, through a judicial system, to the civil population of areas under their control. Abdul Mahbood heads a section in Badakhshan's Keshem District of a new council agency called the Office of Proselytizing and Holy War. "We have men in mujaheddin ranks," he explained, "to control the mujaheddin and check whether local commanders are behaving correctly toward the civil population or whether they're using their positions for personal profit."

Council officials stressed that rugged terrain, difficult communications and traditions of local independence keep the council's administration decentralized, with significant variations from one valley to the next. Although "the level of development may differ from one area to another," a senior council official said, "we are all moving in the same direction. We are trying to spread a unified administration."

Some Jamiat officials regard the Keshem Valley as a model for mujahed civil administration. An agriculturally rich valley on the northern slopes of the Hindu Kush mountains, Keshem has seen little ground fighting, and by Afghan standards, relatively light aerial bombardment. Local records indicated that since 1979, 450 civilians had been killed but that few families had made the three-week trek to refugee camps in Pakistan. The total population is estimated at around 100,000.

Despite occasional skirmishes around the government-held town of Keshem, at the valley's northern mouth, and the threat of bombing, a two-week visit by a western reporter was little affected by the war. As the harvest was gathered, the valley presented a picturesque scene of bucolic tranquility -- in striking contrast to other valleys of the region, where Soviet bombing has been heavy.

According to local residents, the mujahed administration in this valley is well established in part because of a popular and dynamic commander named Arianpur. A 38-year-old former teacher, he is a senior figure in the Supervisory Council of the North. Local officials said he appoints members to a supervisory committee, each with a specific responsibility for military, civil or religious affairs, education, health, finance culture, security, the Islamic judiciary or refugees.

The valley is divided into 14 zones, each with a mujahed garrison for local defense. Each village mosque, which is the basic administrative unit, elects an administrative committee and a representative to a zonal committee. The mosque, zonal and valley-wide committees are meant to pass policy decisions down and grass-roots opinion up between the population and commander Arianpur.

Keshem Valley officials conceded that local elections are by show of hands rather than by secret ballot. And there seemed to be no time limit set for an official's tenure. An official in Jar-i-Shahbaba village said he had held his post on the Civil Affairs Committee for three years, but would relinquish it if the committee of mosque representatives he headed so wished. "If the people think I'm doing a bad job, they can demand that someone else take over," he said.

Senior officials of the Jamiat-i-Islami party stressed, however, that given war conditions and Afghan traditions in which the ballot box has little precedent, the system evolving in council-administered regions could not be democratic in a western electoral sense. They argued that the committee system is far more important as a broadly representative mechanism that serves to organize and involve the population in the war effort and the goals and ideology of the Islamic revolution.

"The resistance in the north is trying to give everybody a chance to play a role in the war . . . through involving the local people in administrative work and letting them choose their own representatives," said Jamiat's Es'Haq.

Foreign analysts said the administrative system has institutionalized shifts of political power in resistance-held zones that mark a significant break with pre-war patterns in rural areas. They said that real power is firmly concentrated in the hands of young, mostly well-educated guerrilla commanders thrown into positions of authority by the war and their own grasp of the need for organization. Controlling the upper echelons of the Supervisory Council of the North, which in turn has bolstered and legitimized their positions, they share an "Islamist" view of Afghanistan's future.

"Islamist" is a name coined by western scholars for a new generation of Moslem fundamentalist revolutionaries with modernizing goals. They see religion not only as a moral and spiritual guide for daily life, but also as a political ideology and mobilizing force in keeping with past traditions.

Afghanistan's Islamists -- often former intellectuals and students -- have been contrasted with the fundamentalist ulema, or traditional religious scholars, who also seek a return to the letter of the Koran and the traditions of the prophet Mohammed, but who have a conservative, even reactionary world view. Unlike the Islamists, the fundamentalist ulema do not view Islam in explicitly ideological terms and are little concerned with questions of state power.

In the northeast, the new breed of young Islamist leaders are mostly from middle- and lower-middle-class backgrounds, rather than the traditional rural elite -- which they often criticize as feudal. Most are products of modern schooling and are committed to a program of Islamic revolution leading to the establishment of a state based on "Islamic values and principles."

Men from poorer rural families are moving into the new power structure as fighting and organizing skills and Islamic credentials become the bases for leadership, instead of such traditional criteria as land ownership or age.

"Whether a man is rich or poor is now of no importance," said Keshem valley official Abdul Mahbood. "The key criterion today is whether he is a good Moslem and an honest man." He said that most of the valley's civil officials are now from poorer families.

Nevertheless, in the tradition-bound countryside, Islamist commanders are calibrating change with extreme care. Officials noted privately that council leaders were acutely conscious of the importance of not alienating the main pillars of the prewar rural power structure -- land-owning notables and the traditionalist ulema.

Where possible, the power brokers of the old system have been coopted and given roles -- with or without real power -- in the new committee structure, they said. "We want the {traditional rural leaders} to help," said Abdul Mahbood. "No one is being pushed aside. If these people are not given a place, they'll go over to the government."

He said that in the Keshem Valley the traditionalist clergy have been given specific roles, for example as religious instructors for mujaheddin and civilian groups.

The Islamist leaders also have advanced cautiously in an area of special sensitivity for many Afghans: education for women. Traditionally, girls have received no education or, at most, purely religious lessons from village mullahs. Two of the most explosive of the reforms attempted by the Kabul government in 1978 and 1979 were efforts to "liberate" Afghan women, who are traditionally confined to the home, and to use the state education system to transmit Marxist values.

Alongside the 28 boys' schools in the Keshem Valley, however, two primary schools for girls have been opened. Local officials and Pakistan-based education specialists said the girls' schools are the first of their kind in mujaheddin-controlled Afghanistan.

The Supervisory Council of the North plans to open more girls' schools as local conditions permit. "According to the Prophet {Mohammed}, education is the duty of both men and women," said Ahmed Shah Massoud. "We want girls to be going to properly established Islamic schools like boys."

"But the establishment and development of these schools must depend on local public opinion and conditions," he cautioned. Sayed Abdul Azim, a senior religious figure in the Keshem Valley who runs the first girls' school to open here, predicted that enrollment would increase from its present figure of 36.

"But whether girls attend school or not must remain entirely dependent on their parents' wishes," he added.

Senior officials of Jamiat-i-Islami, both here and at the party's exile base in Pakistan, conceded that a major obstacle to its plans for social and economic development is a chronic shortage of educated personnel. Many educated men have been killed in the war or have joined millions of Afghan refugees in Pakistan and Iran, they noted. Some sources said efforts to persuade educated refugees to return to help development efforts have lacked sufficient funds and party backing.