FILE PHOTO: Nigerian President Muhammadu Buhari addresses the 72nd United Nations General Assembly at U.N. headquarters in New York, U.S., September 19, 2017. REUTERS/Shannon Stapleton

ABUJA (Reuters) - Nigeria’s main opposition parties have agreed to form an alliance to field a joint candidate to challenge President Muhammadu Buhari in next year’s presidential election, they said in a memorandum on Monday.

Buhari’s ruling All Progressive Congress (APC) split last week when one faction declared it no longer supported his government, threatening the 75-year-old former military ruler’s hopes of securing a second term in the Feb. 2019 elections.

The splinter group, known as the Reformed-All Progressives Congress (R-APC), the People’s Democratic Party (PDP) and 37 other political parties are in the new alliance hoping to defeat the APC.

“The parties agreed to ensure the emergence of a joint presidential candidate,” said the memorandum, which was read out by Tom Ikimi of the PDP.

“The leadership of the parties are hereby committed to work together in a Coalition of United Political Party (CUPP),” it said, adding that the modalities of the new alliance still had to be agreed.

The alliance could pose a major threat to Buhari’s re-election bid as the rifts within his APC threaten to split support for the president within Nigeria’s powerful patronage networks and among voters ahead of 2019 election.

Buhari announced in April that he would seek another term. His candidacy depends on party approval, though that is usually seen as a formality for the incumbent.

Political parties in Nigeria must select their candidates for the election between Aug. 18 and Oct. 7.

Nigeria is Africa’s top oil producer and richest economy. It plays a key role in the regional fight against Islamist militants.