President Olusegun Obasanjo says Nigeria only narrowly avoided war with neighboring Cameroon over ownership of the oil-rich Bakassi Peninsula.

Nigerian and Cameroonian ministers earlier this year announced that Nigerian troops would begin a partial withdrawal from the disputed Bakassi peninsula before the end of the year. However, in his monthly address to the nation, President Olusegun Obasanjo said the two countries nearly came to war on the issue.

Mr. Obasanjo said a war would have cost Nigeria dearly in terms of resources and the country's influence in Africa.

After years of dispute and intermittent clashes over the ownership of the Bakassi Peninsula, the Nigerian and Cameroonian governments took the case to the International Court of Justice. In October, the ICJ ruled in Cameroon's favor.

Nigeria at first refused to accept the ruling, but further negotiations apparently set the stage for what is expected to be an amicable settlement.

President Obasanjo says the two governments are about 25 percent on the way to finalizing a deal after an agreement was reached on the drawing of borders around the Lake Chad area.

Nigerian information minister Chukwuemeka Chikelu said that he is confident the two countries will reach an ultimate agreement on the longstanding issue. "They are two countries that have lived peacefully for many years," said the minister, "and they have decided to pursue an amicable resolution of the crisis, taking into consideration many other factors on the ground."

Nigeria's main complaint with the ICJ ruling was that it was based on old colonial maps and local people were not consulted. Nigeria claims that residents of Bakassi Peninsula are almost all Nigerian fishermen who do not want to live under Cameroonian rule.

The Bakassi dispute began in 1993 and the armies of the two countries have frequently clashed. Though a small piece of land, Bakassi is crucial to determining access to fish stocks and offshore oil reserves.