African leaders meeting in Libya have agreed to set up a joint military force which could intervene to end civil wars or prevent genocide.
Libya's leader (L) wanted all Africa's armies to merge
This is part of a sweeping agreement on defence and security in Africa signed after a two-day summit in Sirte.
The agreement is "a collective answer to threats, whether internal or external, over the continent," said Mozambique President, Joachim Chissano.
The summit rejected a Libyan plan to set up a single African army.
Colonel Muammar Gaddafi's plan, tabled at the last minute, had delayed the closing ceremony of the summit.
Heads of state and prime ministers of the 53-nation African Union unanimously approved the document called Common Defence and Security Policy for Africa.
The African Standby Force will begin deploying about 15,000 troops by 2005.
It will have a peace-building and humanitarian role, and may intervene unilaterally in the event of "war crimes, genocide and crimes against humanity, as well as a serious threat to legitimate order," the text said.
It will be composed of troops from countries such as South Africa, Nigeria, Kenya and Egypt and operate under the African Union Peace and Security Council - expected to be set up in March based on United Nations Security Council.
In extreme cases, African leaders look ready to accept direct intervention in their own states to prevent genocide or serious threats to security, says BBC regional analyst Martin Plaut.
All this is very different from the position taken by the African Union's predecessor, the Organisation of African Unity, which vigorously resisted any interference in the activities of sovereign states, our analyst says.
At the end of the meeting, the leaders also signed an agreement on a common policy to boost agricultural production and manage Africa's water resources.