But the two leaders share something else in common: their fathers' acrimonious history.
In his 1995 memoir, "Dreams from My Father," Obama wrote that his father, Barack Obama Sr., had a longstanding conflict with Kenyan President Jomo Kenyatta, the father of Kenya's current president.
After working in Kenya as an economist for an oil company, the elder Obama took a job as an economist in the Kenya Ministry of Tourism, according to Obama's book.
"He may have had political ambitions, and at first he was doing well in the government. But by 1966 or 1967, the divisions in Kenya had become more serious," Obama wrote. "President Kenyatta was from the largest tribe, the Kikuyus. The Luos, the second largest tribe, began to complain that Kikuyus were getting all the best jobs."
Some Luos, the tribal group of the Obama family, began to increasingly criticize and protest against the Kenyatta administration. Government police cracked down and some people were killed, Obama wrote, causing more suspicion from his father.
"Most of the Old Man's friends just kept quiet and learned to live with the situation. But the Old Man began to speak up. He would tell people that tribalism was going to ruin the country and that unqualified men were taking the best jobs," the President wrote.
Obama Sr. continued to ignore warnings from his friends that his constant criticism of Kenyatta would be his downfall, but he did not listen, according to his son.
"Word got back to Kenyatta that the Old Man was a troublemaker, and he was called in to see the President. According to the stories, Kenyatta said to the Old Man that, because he could not keep his mouth shut, he would not work again until he had no shoes on his feet," he said.
Kenyatta fired Obama's father and he was unable to find work after being blacklisted across Kenya.
Despite his graduate degree from Harvard University and significant experience, the elder Obama could not find work in the public or private sector after this exchange, the President wrote. He eventually found a job in the nation's water department.
"The job kept food on the table, but it was a big fall for him. The Old Man began to drink heavily, and many of the people he knew stopped coming to visit because now it was dangerous to be seen with him," the President wrote. "They told him that maybe if he apologized, changed his attitude, he would be all right. But he refused and continued to say whatever was on his mind."
The President wrote that by the time he was a teenager, his father's career began to improve.
"In my last two years in high school, the Old Man's situation improved. Kenyatta died, and somehow the Old Man was able to work again in government," Obama wrote. "He got a job with the Ministry of Finance and started to have money again, and influence. But I think he never got over the bitterness of what had happened to him, seeing his other age-mates who had been more politically astute rise ahead of him."
At a state dinner in Nairobi on Saturday night, Uhuru Kenyatta offered a toast to the American President.
"Mr. Obama, this is not your first trip to Kenya," he said. "But yesterday, you arrived riding on the wings of history."
Kenyatta spoke about Obama's father, saying both Obamas share the same convictions.
"He had the same audacious hope that you have," Kenyatta said.