Updated

Kenya has terminated local operations of the U.S.-funded International Foundation for Electoral Systems, just months before this East African country holds its next presidential election.

Fazul Mohamed, executive director of the agency that regulates non-governmental groups, said in a letter to the U.S. government's aid agency that it has ended the $20 million IFES program for electoral education for Kenya's upcoming general election. The letter said IFES is not a registered NGO and all foreigners working there were doing so illegally.

In a speech last week, Kenyan President Uhuru Kenyatta claimed that money coming into the country in the guise of supporting good governance or civic education is being used to influence Kenyans' electoral choices.

Kenyatta has accused opposition leader Raila Odinga of conspiring with foreign countries to remove his administration. Kenyatta came to power in 2013 amid a wave of resentment at perceived attempts by the West to influence elections.

At the time Kenyatta and his deputy, William Ruto, were facing charges of crimes against humanity at the International Criminal Court for allegedly orchestrating violence after the December 2007 flawed election in which former President Mwai Kibaki claimed victory over Odinga. More than 1,000 people died and 600,000 were evicted from their homes.

Kenyatta and Ruto were on opposing sides of the conflict but joined forces after they were named suspects. Their campaigns spread the message that the ICC charges were meant to clear the way for Odinga. A comment by a U.S. diplomat that "choices have consequences" was taken by some Kenyans as an example of the West's interference.

The charges against the two have since been dropped, but the ICC prosecutor says the lack of evidence was caused by witness interference and intimidation.