Hashmatullah Mojaddidi still can't understand what went wrong with his old friend "Najib."

Mojaddidi, a leader in the Moslem resistance movement fighting the Soviet occupation of Afghanistan, was as surprised as anyone here by the announcement on May 4 that his former high school classmate, Najibullah, had been named to head Afghanistan's ruling communist party.

Najibullah, a medical doctor who until last December directed his country's feared secret police, is little known outside Afghanistan. But Mojaddidi and other Afghans here remember him as a devout Moslem teen-ager who during his university years became a fervent, and often violent, communist organizer.

Najibullah's personal background and his recent role in the Afghan government lead many in the resistance movement to believe that he has been assigned to draw new groups, especially among the ethnically dominant Pashtun tribes, into the government camp.

Several observers here assert, however, that Najibullah will be hampered by the same factional conflict within the Afghan communist party that has always obstructed efforts to consolidate its rule.

Najibullah, who uses no surname, was selected to replace Babrak Karmal as leader of the Soviet-dominated People's Democratic Party of Afghanistan. As in the Soviet Union, the party leadership is regarded as the nation's most important political office.

"When we were in high school, Najib was a good Moslem," said Mojaddidi, who is the financial director of the Afghan National Liberation Front, one of the main resistance parties. "One day, we had gone swimming near Kabul and were riding our bicycles back and Najib made us stop on the way for prayers. He never missed his prayers," Mojaddidi said.

When the communist People's Democratic Party of Afghanistan was founded in 1965, Najibullah and Mojaddidi were classmates at Kabul's Habibia high school. Shortly thereafter, Mojaddidi recalled, Najibullah had told friends that Suleiman Layeq, a founding member of the party and now minister of tribes and nationalities, was trying to recruit him.

Najibullah "agreed with us that these were not good people, because they did not believe in God," Mojaddidi said. "But later, when he went to the university, he changed. I do not know why," Mojaddidi added.

At Kabul University, "Everybody knew him," said Mohammed Haidar, formerly dean of the law faculty. "He was very active, with so many speeches and demonstrations he had to repeat about two years of classes before he got his medical diploma."

In the frequent clashes on campus between the two main factions of the party, "You would always hear later that Najibullah had been in the front of the fighting," said former Kabul University Prof. Rasul Amin. "They called him Najib the bull."

Najibullah is from an elite family that is part of the large and important Ahmadzai tribe of Pashtuns. The family originally was from rural Paktia Province, on the border with Pakistan, but Najibullah grew up in cities, here in Peshawar and in Kabul.

"His father was a banker and a commercial agent, and had many contacts among the [Pashtun] tribes of the border region," Amin said. One of Najibullah's main tasks as director of Khad, the secret police, was to recruit members of his own and related tribes along the Pakistani border into a militia to obstruct the passage of resistance fighters, especially through Kunar, Ningrahar and Paktia provinces.

The recruitment of the tribes -- often in exchange for arms, money or promises of noninterference from the government -- has complemented Soviet military offensives as a tactic to deny the resistance access to critical supply routes through the border provinces to the Afghan interior.

"Najibullah has been successful in manipulating the border tribes against the resistance fighters because of his knowledge of their traditions and their rivalries," said Asmat Hayat Khan, a Pakistani scholar at Peshawar University's Central Asian studies program.

Like most observers here, Khan believes Najibullah's selection signals an intention by the Soviets to step up their efforts to convince or coerce the border tribes to stop supporting or tolerating the resistance.

The Pashtuns comprise an estimated 55 percent of Afghanistan's population, and are easily dominant among the country's 21 distinct ethnic groups. Afghanistan traditionally has been ruled by Pashtuns. Afghan intellectuals say this would make it difficult for the Soviets to designate a leader from another ethnic group. The Parcham and Khalq factions of the communist party are divided largely along ethnic and linguistic lines.

The two groups coalesced early in the development of the party, with Pashtuns from rural areas -- often of relatively poorer backgrounds -- joining the Khalq. Urban Afghans, mostly from Persian-speaking, non-Pashtun ethnic groups followed Babrak Karmal's Parcham faction.

Although Pashtun, the urbanized Najibullah was recruited by Babrak's group, and quickly earned a reputation as one of its most combative members. In August 1978, he was banished to an ambassadorial post in Tehran after he, Babrak and others were suspected of plotting against the Khalq government that had taken power that April.

When the Soviets invaded in December 1979, they overturned the Khalq regime and installed Babrak at the head of a government that included both factions. During its 20 months in power, the Khalq faction had ignited an angry rural resistance movement with its doctrinaire enforcement of radical changes that violated religious and cultural norms.

Under Soviet guidance, Babrak moderated the government's program, and made efforts to display respect for traditions. But during more than six years of Babrak's rule, the infighting has continued, with frequent assassinations by each group against the other.

According to some observers here, the Soviets may hope that Najibullah will be able to appeal to his fellow Pashtuns in the Khalq faction as a way of resolving the infighting. Most Afghan analysts agree with Mohammed N. Zalmy, a former Kabul judge who now monitors human rights violations in Afghanistan, that this is unlikely.

Zalmy recalled that, in recent years, Najibullah's Khad has been a major Parchami weapon against the Khalq, with Khad agents arresting officers of the Khalq-dominated Interior Ministry, and vice versa. "Najibullah is the biggest enemy of the Khalqs," Zalmy said.

Western diplomats in Islamabad, quoting reports from Kabul, said that during the recent transition from Babrak to Najibullah, Soviet troops and tanks guarded strategic points around Kabul, apparently to forestall any factional violence.

Rasul Amin speculated that it might be wrong to think that the Soviets are resolved to seek the reconciliation in the party that has eluded them since their invasion. "They may have decided that, instead, it is time to crush the Khalq," he said.

"If so, Najibullah is the man they should have," Amin said. "He is tough and ruthless. And since he has been running the secret police for them, it is certain that he is the Soviets' own man."