Former U.S. President Barack Obama Monday praised Kenya's president and opposition leader for working together but said this East African country must do more to end corruption.

Obama, on his first visit to Africa since stepping down as president, commended President Uhuru Kenyatta and opposition leader Raila Odinga for cooperating following last year's disputed presidential election which were marked by violence.

"Despite some of the tumultuous times that seem to attend every election we now have a president and major opposition leader who have pledged to build bridges and have made specific commitments to work together," said Obama, speaking in Kogelo in Siaya County, the rural birthplace of his late father.

"So what we see here in Kenya is all part of an emergence of a more confident, more self-reliant Africa. But we know real progress means addressing the problems that remain. It means rooting out corruption that weakens civic life," he said.

Other challenges facing Kenya, Obama said, are tribalism and the need for better education. Since visiting Kenya as senator in 2006 and then as president in 2015, Obama has passionately urged Kenya to tackle its endemic corruption and problems surrounding the divisions between this country's ethnic groups. In 2006, he angered the government of President Mwai Kibaki when he gave a talk about corruption at the University of Nairobi. The government spokesman responded calling him "an inexperienced young man who could not teach Kenya how to manage its affairs."

Obama went to Kogelo on Monday to launch a sports and training center founded by his half-sister, Auma Obama, through her foundation Sauti Kuu.

Thousands of Kenyans turned up in his ancestral home of Kogelo to see Obama but many could not get into the venue due to high security.

"We are here to welcome our brother Barack Obama, but we have several challenges because we are not able to see our son," said Boniface Rachula, a farmer from Kogelo who was turned away from the event.

"We wanted to appreciate Barack Obama for what he has done. In fact he has developed the community through giving iron sheets for people to build their houses," he said.

Obama's current visit to Kenya is low key, unlike his previous trips where he electrified thousands of Kenyans who lined the streets to see him.

Many Kenyans consider Obama native to this country — a local kid made good — and bask in the glory of his success, despite the fact that he never lived in Africa. He was born in Hawaii, where he spent most of his childhood raised by his mother, a white American from Kansas. He barely knew his father for whom he was named, Barack Obama, an economist.

"It is a joy to be with so many people who are family to me and so many people who claim to be family to me. Everybody is a cousin," Obama said in jest.

Later Monday he left for South Africa where he will deliver the annual Neslon Mandela lecture which this year will mark the late anti-apartheid icon's 100th birthday.