In a clear effort to heal the still festering wounds of the decade-old Nigerian civil war, President Shehu Shagari today granted federal pension rights previously denied to thousands of civil service servants in the old rebel state of Biafra.

As Nigeria's first civilian president after 13 years of military government, Shagari made his surprise announcement as a part of efforts to strengthen the formerly frayed political fabric of this most powerful of black African nations.

Shagari, in his characteristic low-key style, has consistently avoided the confrontation politics of post-independence that led to violent civil turbulence, military rule and, finally, a bitterly fought civil war.

Nigeria today, as a major exporter of oil, is one of his continent's richest countries. It is the most populous with an estimated population of more than 90 million people divided into some 250 contentious ethnic groups, a condition that Shagari alluded to today.

Shagari's speech was characterized by Nigerian observers as the strongest yet delivered by the soft-spoken, generally cautious 55-year-old politician. Today is the first anniversary of Shagari's civilian government and Nigeria's 20th anniversary of independence.

Besides the olive branch offered to Nigeria's eastern population of the former Biafran rebel state, Shagari issued a second appeal in less than a year for the end of "political victimization" by "fanatics" that has led to an unknown number of killings. He admonished the civil service, often described as inert, that those resisting his policy directives will be fired.

The government is Nigeria's principal employer. Shagari has encountered resistance to change on the part of high level civil servants carried over from past military governments. This problem is complicated by the divided ethnic, regional and political loyalties.

Other than the Ibos of former Biafra, the other two major ethnic groups are the northern Hausa-Fulani and the western Yorubas. The three groups compromise 60 percent of the population.

Nigeria has five political parties, each with strong regional and ethnic representation. The country has been divided into 19 states to lessen fears of ethnic dominance that led to past violence and the civil war.

The country's oil revenues have more than doubled in the past two years, to an estimated $25 billion for this year, and Shangari's government has embarked on an ambitious program of agricultural self-sufficiency and industrialization. o

Since independence from Britain in 1960, Nigeria has been tenuously held together despite three military coups, one bloody attempted coup and the 2 1/2-year civil war that cost an estimated million lives when the eastern Ibos tried to secede. The war ended in Biafra's defeat in 1970.

The Army, which took power admits political turbulence in 1966, voluntarily handed over to Shagari's elected government one year ago.

Shagari, in his speech broadcast at 7 a.m., said he was restoring pension rights to the thousands of rebel civil servants "cut off in the former eastern regions during the period of the civil war."

These civil servants, continued Shagari, "through subsequently re-absorbed into the service, were told that the period during which they were cut off was to be counted as lost for purposes of pension entitlements. I have now given a new directive that his period should be regarded as leave without pay on grounds of public policy and therefore pensionable," Shagari added.

Two state governors of the former Biafran heartland, Jim Nwobodo and Samuel Mbakwe of Anambra and Imo states respectively, have been vociferously critical over the past year of what they say has been a lack of rehabilitation efforts for the formerly war-torn region both on the part of the former military government and Shagari.

In an interview earlier this year, Gov. Mbakwe complained that many Ibos remain embittered by the war. One reason they feel less than a part of Nigeria, he said, was that the civil servants had been denied their pension rights.

It was not known today what the reactions of the two governors were to Shagari's announcement.

On another note, Shagari said the most significant achievement of his first year in office would be "the peaceful and successful transition from 13 years of military rule to a democratically elected civilian government."

His government, Shagari added, has "succeeded in diffusing tension, preserving peace, stability and national unity in spite of seemingly insurmountable odds." At its inception, both Western and Nigerian political observers said they would be surprised if political turbulence did not revive within the first year. It has not.

But Shagari, for the second time since January, restated an appeal for an end to political violence. While less than under the post-independence civilian government, political violence does still occur.

"My disappointment" in events over the past year, he said, "relates to the occasional wranglings that have plagued some of the political parties and misguided attitude of a few politicians. Another disturbing feature of the year under review are the alleged and proven cases of political victimization by party fanatics," he added. "In some cases lives have been lost."

Shagari warned civil servants who have "yet to tune" themselves to the requirements of his government that they will be fired.

"I want to make it abundantly clear for the avoidance of doubt that any civil servant in the federal government or its agencies found wanting or found obstructing the smooth and speedy implementation of the programs of this administration will be removed," he said. "I hope I shall have no caused to repeat this warning."

Shagari also:

Appealed for an end to the fighting between Iraq and Iran and called "on all major powers to honor their declared intention of nonintervention in this conflict."

Mentioned the present glut on the world oil market that might force down the present price of $37 a barrel for Nigeria's high-quality crude. The United States presently imports half of Nigeria's daily 2.2 million-barrel-a-day production, making Nigeria the second supplier of U.S. needs after Saudi Arabia.

Shagari leaves Nigeria on Thursday for New York and Washington on his first official trip outside Africa since taking office. He will address the U.N. General Assembly and visit with President Carter during his weeklong stay in the United States.