BEIRUT, OCT. 25 -- The three principal Moslem and Christian militias in Lebanon agreed today to withdraw from Beirut and its suburbs in line with the government's plan to end the 15-year-old civil war. No date was announced.

President Elias Hrawi's government obtained agreement from Samir Geagea's Christian Lebanese Forces militia, Nabih Berri's Shiite Amal militia and Walid Jumblatt's Druze Progressive Socialist Party.

The pullout area covers "greater Beirut" -- the Moslem and Christian sectors of a capital divided since the outbreak of the civil war in 1975, and its immediate suburbs.

The pro-Iranian Hezbollah -- the fundamentalist Shiite Moslem umbrella organization for groups holding U.S. and other foreign hostages -- said only that it will announce its decision after holding talks. On Wednesday, police said Hezbollah handed over some Beirut positions to government troops but maintained its stronghold in the south Beirut slums.

Agriculture Minister Mohsen Dalloul and Defense Minister Albert Mansour, assigned to follow up the plan with militia leaders, are to "put the final touches to the mechanism of the militias' withdrawal," a government source said.

The plan was announced 11 days after Lebanese and Syrian forces crushed rebel Gen. Michel Aoun's 11-month mutiny in an assault on his enclave in the Christian heartland northeast of Beirut. Aoun and his top military aides have taken refuge in the French Embassy but Lebanon has refused to allow them to leave, insisting they should face a court of law for a variety of charges, including the theft of state funds.

The militia plan, conceived in line with an Arab League-brokered peace pact, envisages the disbanding of all the warring militias throughout the nation.

The peace pact, ratified by parliament on Aug. 22, 1989, distributes power equally between Moslems and Christians, shifting some power to the Moslem majority.