The war for control of Chad's capital ended nearly a month ago, but here, just across the river border, tens of thousands of Chadians are settling in for what may be a long, depressing existence as refugees from that ravaged country.

More than 100,000 Chadians have taken refuge in crowded camps near this town of 15,000, a former French Legion outpost, and few are eager to return to Chad, where the political situation is still far from certain.

Their discomfort here is matched by that of Cameroonian officials, whose difficulties in caring for the flood of refugees are growing as the same factionalism that led to the civil war in Chad begins to disrupt the camps.

The ethnic, religious and regional prejudices that the refugees have imported into this crowded camp, relief officials say, has created additional tensions and caused some fighting, but so far nothing serious. In addition, at least 2,000 of the defeated but unarmed guerrillas from Ndjamena, the capital of Chad, have slipped into refugee status in the camp since the fighting ended and are seen as another source of friction.

The problems here were exacerbated last fall when U.S.-donated grain was tied up by Cameroonian customs officials in the Atlantic port of Douala, leaving the refugees without their major diet staple from September to November.

There are still problems in distribution of grain, as supplies continue to dribble into Kousseri, but relief officials said they are worried more about how long the refugees will remain. The camp stretches southward from Kousseri, a river port located at the point where the Logone River, which forms the border between the two countries, empties into the Chari River.

Built on a dusty plain that will turn into a desease-breeding swamp in the spring rainy season, the first section of the camp was erected in June and continues to grow as a steady but smaller stream of refugees continues to leave Ndjamena.

The Office of the U.N. High Commissioner for Refugees has built 40 barracks for 500 of the estimated 17,000 families. The rest make do with tents donated by the European Community with grass huts.

"By the rainy season," one U.N. official said, "this camp is going to be a catastrophe. And by Jan. 25 or 26, we face a difficult decision" on how much more money to put into the camp now that fighting apparently has ended in Ndjamena.

U.N and European Community donations have amounted to $7.6 million while U.S. aid, mostly food, totals $7.5 millin. In addition, the Catholic Relief Serivice is caring for undernourished children, and the Red Cross is looking after health needs.

The refuagees will return to Ndjamena when the security situation allows it," said Mahmoudou Moussa, a Cameroonian official in charge of refugee administration. "The Chadian government knows when that will be," Moussa added, "but we do not."

Warfare ended in Chad when a coalition of forces loyal to transitional President Goukouni Oueddei, with heavy Libyan support, drove former defense minister Hissene Habre and his forces from the city. On Tuesday, Libya, a wealthy oil nation that borders Chad on the north, said the two countries would merge.

Chadian officials sought out during a recent trip to Ndjamena were not available for comment on the refugee issue or other matters. A number of Chadian civilians in Ndjamena said, however, that the city remained insecure, particularly at night when bands of armed men dressed as soliders roamed the streets demanding money.

"We know we will not be returning to Ndjamena for a long time," said refugee Bakimbil Ramadan, 30. "There have been two wars over Ndjamena and we feel that a third can break out at any time."

Although he has an Arabic name, Ramadan is a southerner whose regional group dominated the government when Chad won independence from France in 1960. The southerners, nominally Christians or believers in traditional African religions, were defeated in the first battle for Ndjamena by northern Moslem guerrillas. In February 1979 after 14 years of desert warfare.

The second battle for Ndjamena, which began last March and ended in December, involved the 10 Moslem factions in a power struggle as the southerners largely watched from the sidelines.

"There are problems of life [in the camp] but there is also security," said Ngarouskou Ngarssat, 62. "The Cameroonian Army is here to protect us and for that we are grateful," added Ngarssat, leader of a Moslem section of the camp that contains 2,700 families.

Ngarssat fled to Kousseri on April 3 after rockets from Goukouni's forces fell into his neighborhood in Ndjamena during an attack on Habre's positions. f

"My wife, my eight children and I were able to cross the Chari on foot as it was low and then a man in a pirogue brought us over the Logone," Ngarssat said. "Do you think we want to go through that again when all here know that the war in our Chad is not finished?"

Many refugees from his section, Ngarssat said, returned to Ndjamena shortly after the fighting ended, but they spent only one night and then returned.

"Soldiers of all factions came at night to bother them and the Libyans came asking for young girls," Ngarssat said. "We don't want to return."

Ramadan, who is in charge of a smaller section of the camp of 448 families, said that life for his wife, seven children and all the refugees he has talked to is better in the camp than it would be in today's Ndjamena even if the city were safe. Because of the fighting, many of the city's services are not operating and food is costly.

"It is better to come here and live because the assistance is concentrated here," said Ramadan. "It is better to be identified as a refugee because we get food, medical care and free water. Otherwise, we would have to pay for these things."

But the maze of Chadian refugee politics has relief officials worried. Habre's guerrillas living in the camp, said a commission official, "are trying to persuade people to stay here," much to the officials' dismay.

"If we continue to provide the same level of facilities, then [Goukouni's government] will accuse us of trying to keep their people in Kousseri," the U.N. official said. "If we don't, then [Habre's guerrillas] will accuse us of driving the refugees out of the camp. There doesn't seem to be a solution."