NAIROBI (Reuters) - Burundi opposition groups demanded an international mediator resign just days after he arrived, casting a shadow over already troubled efforts to resolve months of political violence.

Mediator Benjamin Mkapa flew in on Friday at the head of an African peace mission, then gave a speech at the airport that anti-government groups said appeared to recognise the legitimacy of Burundi’s leader - the issue at the heart of the conflict.

The main opposition grouping CNARED released a letter dated Monday telling Mkapa, a former president of Tanzania, to go.

“The CNARED does not recognize you as facilitator in inter-Burundian conflicts any more,” it said. Mkapa, who is representing the East Africa Community bloc, was not immediately available for comment.

Burundi has been mired in political crisis and sporadic violence for almost two years, triggered by President Pierre Nkurunziza’s decision to run for a third term in office, which he secured in a disputed election in July 2015.

Opponents accuse the president of violating the constitution and a peace deal that ended a civil war in 2005. The government accuses opponents of fomenting unrest and backing rebel groups.

The violence has alarmed a region where memories of the 1994 genocide in neighboring Rwanda remain raw. Like Rwanda, Burundi has an ethnic Hutu majority and a Tutsi minority.

Mkapa told reporters at the airport that his priority was to ensure that the next presidential election in 2020 was free and fair.

“It’s the people of Burundi who have lent legitimacy to the president of Burundi ...those who think I am the one who is lending legitimacy are absolutely out of their mind.”