NAIROBI, Kenya—Amid a push from Washington, Kenya’s president and his opposition rival on Friday promised to bury the hatchet on months of bitter standoff, an unexpected turn that came hours before Secretary of State Rex Tillerson landed in Nairobi.

The East African country, an important player on the continent in the U.S. war on terror, has been mired in political uncertainty after two fraught elections and bursts of violence.

In...