KOGELO, Kenya (Reuters) - Former U.S. President Barack Obama urged Kenya’s leaders on Monday to turn their backs on the divisive ethnic politics that have frequently spilled over into violence and to stamp down on corruption.

Opening a school in his father’s home village of Kogelo in western Kenya, Obama praised a rapprochement between President Uhuru Kenyatta and opposition leader Raila Odinga but said they must do more to heal the rifts between Kenya’s 40-odd ethnic groups.

In the worst recent outbreak of ethnic conflict, 1,200 people were killed in fighting that followed disputed elections involving Odinga and Kenyatta in 2007.

“It means no longer seeing different ethnicities as enemies or rivals but rather as allies; in seeing the diversity of tribes not as a weakness but as a strength,” Obama, whose father was Kenyan, said.

America’s first black president, whose eight years in office preceded Donald Trump’s election in November 2016, was in Kenya to open the center, which is run by his half sister Auma through her charity, the Sauti Kuu Foundation.

Slideshow ( 7 images )

It was his fourth trip to Kenya. He made his first in 1987, a journey he chronicled in his book “Dreams From My Father”, followed by a 2006 visit as a senator and then in 2015 as president.

During his visit, Obama avoided any public mention of his successor and the divisive politics that have taken root in the United States since Trump’s victory over Democrat Hillary Clinton.

Obama also noted the corruption scandals that have blighted Kenyatta’s administration, saying graft held back economic development and undermined public faith in the government.

Kenyan media have reported dozens of graft scandals since Kenyatta was re-elected last year. In May, 54 people, mostly civil servants, were charged in an investigation into the theft of nearly $100 million of public funds from the state-run National Youth Service.

After Kenya, Obama will travel to South Africa, where he will deliver a speech marking the 100th anniversary of the birth of anti-apartheid icon Nelson Mandela.