Barack Obama has ended a two-day visit to Kenya, his father's birthplace, by declaring himself the "first Kenyan-American to be president of the United States".
Despite clearly being proud of his roots, Obama has not shied away from confronting potentially difficult issues while on his trip to Africa that will also see him travel to Ethiopia.
While standing next to his Kenyan counterpart Uhuru Kenyatta on Saturday, Obama raised the issue of gay rights, in a country where homosexuality is illegal and can lead to a prison sentence of 14 years.
When you start treating people differently not because of any harm they are doing to anybody, but because they are different, that's the path whereby freedoms begin to erode. And bad things happen.
The message was lost on Kenyatta, however, who said that gay rights was "generally a non-issue" for most Kenyans.
On Sunday, Obama told an audience in Nairobi that Kenyan traditions such as FGM and forced marriage that treated women as second-class citizens were "holding you back".
Citing the debate in the US over the Confederate battle flag, the president said:
Every country and every culture has traditions that are unique and help make that country what it is, but just because something is part of your past doesn't make it right; it doesn't mean it defines your future.
Around the world there is a tradition of oppressing women and treating them differently and not giving them the same opportunities, and husbands beating their wives, and children not being sent to school. Those are traditions. Treating women and girls as second-class citizens. Those are bad traditions. They need to change.
The comments at a sports arena in the Kenyan capital were greeted with applause and cheers.