A peace agreement ending the seven-year-old civil war in Rhodesia was reached tonight after the Patriotic Front guerrillas accepted a British compromise on arrangements for a cease-fire.

Patriotic Front leaders Robert Mugabe and Joshua Nkomo then initialed the cease-fire document and the other agreements reached at the peace conference here. They will enable Rhodesia to achieve legal independence under black-majority rule 14 years after the white minority, led by Ian Smith, broke away from Britain.

Representatives of Britain, which convened the peace talks here 15 weeks ago, and the short-lived biracial government of Rhodesian prime minister Abel Muzorewa initialed the package of agreements at the last formal session of the conference last Saturday.

A formal signing cermony will now be held here Wednesday after British Prime Minister Margaret Thatcher and her foreign secretary, Lord Carrington, the peace conference chairman, return from the United States.

Under the timetable agreed to here, the cease-fire will be declared officially a week later, on Dec. 26, and will take effect another week later, on Jan. 2. This presumably will allow time for word to get to all the combat forces. New elections to choose the black-majority government will be held in March, with the Patriotic Front Participating for the first time.

About two weeks after the elections, when a new government has been formed under the independence constitution negotiated earlier in the peace talks, the British governor now in Salisbury to supervise the cease-fire and the elections will grant independence to the country, which then will be known as Zimbabwe.

"This is a very important day for Rhodesia," said Carrington's deputy chairman at the peace conference here, Sir Ian Gilmour. "It means the end of the war after extremely long and difficult negotiations.

"The successful ending to the peace conference," he said, "is a tribute to the perseverance and dedication of all three delegations" and to the help received from the Commonwealth, the five front-line African nations that had supported the guerrillas during the war, and the Carter administration.

[In Washington, the White House later issued a statement saying, "The world can celebrate a triumph of reason and an extraordinary diplomatic success. A long, destructive and tragic conflict is ending.]

Tonight's climactic agreement came after three days of intensive negotiations between British and Patriotic Front officials over how, where and when the guerrillas would gather at designated assembly places to observe the cease-fire in Rhodesia.

Nkomo and Mugabe refused to initial the peace agreements on Saturday because they felt the makeshift camps into which the guerrillas were to assemble were too few in number and too far from the strategic "heartland" around Salisbury. They complained that these arrangement would place their troops in danger and make it appear that they had surrendered.

After a series of meetings over the weekend, many of them between British and Patriotic Front generals, the British agreed to increase the number of guerrilla camps from 15 to 16, with the additional camp to be located in the Rhodesian heartland.

In decisive final discussions this evening, according to Magabe and Nkomo, the British also agreed to formally annex to the cease-fire agreement Carrington's earlier promise that the British governor in Salisbury would "assess the need for more sites" if more guerrillas turned up from the bush than the British expected.

Magabe and Nkomo called this "a firm assurance that more assembly places would be allocated to the Patriotic Front by the governor upon discovering the need for additional sites."

The British have estimated that the 16 currently designated camps would hold 20,000 guerrillas. Patriotic Front spokesmen have said there are between 30,000 and 35,000 armed guerrillas inside Rhodesia.

Mugabe and Nkomo also told reporters they received assurances from the British today that any guerrillas who are unable to reach the assembly points within two weeks of the cease-fire, as specified in the cease-fire agreement, will not automatically be declared "illegal" by the British governor, Lord Soames.

"Whether or not troops not assembled in time become illegal will not be decided arbitrarily," Mugabe said. "It will not be automatic. It will not be determined by the governor alone, but in consultation with the cease-fire commission on which commanders of both the guerrillas and the former Salisbury government's forces will be represented.

Because of Rhodesia's size and geography and the current rainy season there, Mugabe said, it would be impossible for all guerrillas to assemble so quickly and it would be unfair to penalize them.

Large numbers of Patriotic Front guerrillas are still infiltrating into Rhodesia from bases in neighboring Zambia and Mozambique.

To prevent either side from intimidating the other, both will be monitored by 1,200 Commonwealth troops from Britain, Australia, New Zealand, Fiji and Kenya. Cease-fire violations will be reported to a cease-fire commission.

Civilian observers from Commonwealth countries will monitor the elections, which the British and all parties have promised will be free and fair. Complaints during the campaign will go to an election commission on which all parties will be represented.

Teams of British election and police officials will supervise the existing white-dominated Rhodesian civil service and police force in staging the election and routinely maintaining law and order. Lord Soames has absolute authority over the Rhodesian government during the three months until independence.

Nkomo, a huge, gregarious man, and Mugabe, slightly built, bespectacled and alternately taciturn and fiery, tonight promised to honor the agreements achieved here as long as the other parties do. Mugabe said he was confident that disputes that are likely to arise will be settled fairly.

Asked if the Patriotic Front wings they head will contest the election together, Nkomo said, whie Mugabe remained silent, "We are the Patriotic Front, you see us here. We fought the war as the Patriotic Front, we negotiated as the Patriotic Front, and we will fight the election as the Patriotic Front."

"The whole successful conclusion of this conference has been brought about chiefly by the patience, persistence and determination of the Patriotic Front," Mugabe and Nkomo said in a joint statement. "The settlement is the direct product of the sacrifice, sweat and blood of the fighting young men and women as well as the gallant revolutionary masses of Zimbabwe."

On Saturday, the former Salisbury government's deputy prime minister, Silas Mundawarara, called the peace agreements "a victory" for the "statesmanlike decisions" of Muzorewa's delegation and the biracial government behind it, which is splitting into numerous political parties to contest the election.

It is also a diplomatic triumph for both Britain and the Commonwealth, the loose collection of former British colonies that came into its own as a diplomatic presence during these negotiiations.

First, Carriington convinced Thatcher last summer that she could not simply confer legality on Muzorewa's government because of the special power it reserved for the 250,000 whites in Rhodesia's population of 7 million. Then she and the other Commonwealth leaders meeting in Lusaka, Zambia, in August agreed to hold the peace conference here. Britain guaranteed the attendance of Muzorewa's delegation while Comonwealth African countries promised that the Patriotic Front would attend.

Carrington decided against real negotiations between the two warring sides, for fear that they would never agree. Instead, the British decided what the best compromise would be on each issue and forced the other two delegations to agree stage by stage, until they had gone too far to back out.

The biggest concession for Muzorewa's delegation, especially the whites in it, was accepting the independence constitution. It guarantees the white minority a 20 percent representation in the legislature for seven years, but takes away their blocking power there and power over the civil service, police and military.

Mugabe said tonight that the Partiotic Front remains unhappy that the whites have any special representation at all. The guerrillas also had to give up their strong demands to share government, police and military power before a new government was elected.

The British made significant concessions, however, to the guerrillas' demands for safeguards of their interests. The Commonwealth monitoring force and the presence of so many British officials in Rhodesia had to be sold to Thatcher, who had not expected Britain to be so involved in Rhodesia during the uncertain cease-fire period.

When Carrington and the guerrilla leaders reached an angry stalemate over the concept of the cease-fire, the London-based Commonwealth Secretary general, Shridath Ramphal of Guyana, offered a formula that helped both sides save face and move to the next stage of the negotiations.

Thatcher assured both Kaunda and Ramphal in conversations with them at those critical junctures that she was determned to achieve a peace agreement and make it work "on the ground" in Rhodesia.