On his first presidential trip to his father’s homeland in east Africa, Mr Obama said: “When it comes to the people of Kenya, particularly the youth, I believe there is no limit to what you can achieve.”
But he criticised traditions that led to the repression of women and girls.
Mr Obama said: “Around the world there is a tradition of repressing 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. They are holding you back.
“There is no excuse for sexual assault or domestic violence. There is no reason that young girls should suffer genital mutilation.
“There is no place in civilised society for the early or forced marriage of children. These traditions may date back centuries, they have no place in the 21st century.”
His remarks came a day after he ruffled feathers by stating his belief in equal rights for homosexuals, an issue Kenya’s president Uhuru Kenyatta dismissed as a “non-issue” for many ordinary Kenyans.
Later on Sunday, Mr Obama arrived in neighbouring Ethiopia, the headquarters of the African Union.