– The first time Barack Obama was in Kenya, his sister picked him up at the airport in her battered Volkswagen. This time, he arrived on Air Force One and she rode with him in his armored limousine.

Obama didn't get back to his family's village on this trip, but its influence was never far as he visited Kenya for the first time as the U.S. president.

He used his family's story to tell Kenya's history and on Sunday delivered both a pep talk and a challenge.

"I'm confident that your future is going to be written across this country and across this continent by young people like you, young men and women who don't have to struggle under a colonial power; who don't have to look overseas to realize your dreams," Obama said to an audience of about 4,500 in a sports stadium. "You can realize your dreams right here, right now."

Obama noted that two generations ago, that wasn't so. His grandfather was a servant for the ruling British, forced to carry a passbook that referred to him as a boy, "though he was a grown man." And his father, he said, returned to Kenya after a U.S. education, but "couldn't reconcile ideas that he had for his young country with the hard realities that confronted him."

Now, he said, Kenya has political stability, a booming economy and a free press.

But Obama also relied on his favored son status to bluntly point out where he believes Kenya falls short with "problems that shadow ordinary Kenyans every day."

He prodded its government — and its people-to root out corruption, strengthen democracy, address inequality, embrace diversity and change attitudes toward women and girls.

Corruption costs Kenya 250,000 jobs a year, he said, with every Kenyan shilling paid as a bribe one that "could be put into the pocket of somebody who's actually doing an honest day's work."

Tribal divisions

He called on the country to put aside tribal divisions that have spurred violence, warning that "a politics based solely on tribe and ethnicity is a politics that is doomed to tear a country apart."

And he challenged the country to more fully embrace democracy and give opposition groups the space to speak.

"Democracy is sometimes messy," he said, noting it means "somebody is always complaining about something." But, he added, "that's why it works, because it's constantly challenging leaders to up their game and to do better."

He vowed to stand with Kenya in battling the Somalia-based terrorism group Al-Shabab, but urged Kenyans not to turn on Muslims and Somalians who live among them.

Urging Kenyans to abandon traditions such as forced marriages for young girls and female genital mutilation, Obama cited the U.S. debate over the Confederate flag. After the South Carolina church shooting, he said, more Americans recognize it shouldn't be flown.

"Just because it's a tradition doesn't make it right," he said.

Those remarks were clearly more popular with the women in the audience. But students, several clutching American and Kenyan flags, said they were overjoyed by Obama's message and believe it will resonate beyond his visit.

"I feel encouraged, motivated," said Harriet Opama, 24, a third-year student at Kenyatta University who lives in western Kenya near the border with Uganda. "He told us that background doesn't determine your future. Your future lies in your hands."

Obama's stepsister, Auma Obama, introduced her brother, saying that he was "our family, he's one of us. But we're happy to share him with the world because he's not just ours."