Former President Barack Obama, emerging from partial seclusion more than six months after leaving office, weighed in on Monday about the tense political situation — not in the United States, but in his father’s home country, Kenya.

Mr. Obama, who has largely stayed out of the fierce debates that have consumed the United States since President Trump took over in January, opted to speak out about the hotly contested presidential election scheduled for Tuesday in Kenya, where voting in recent years has been followed by violence.

“I urge Kenyan leaders to reject violence and incitement; respect the will of the people; urge security forces to act professionally and neutrally; and work together no matter the outcome,” he said in a statement. “I urge all Kenyans to work for an election — and aftermath — that is peaceful and credible, reinforcing confidence in your new Constitution and the future of your country. Any disputes around the election should be resolved peacefully, through Kenya’s institutions and the rule of law.”

Few voices from outside Kenya could resonate more powerfully than that of Mr. Obama, whose father, Barack Obama Sr., was a Kenyan student who met and married Stanley Ann Dunham in Hawaii but left about a year after their son was born.