KENYAN PRESIDENT Uhuru Kenyatta could have presided over a landmark consolidation of democracy last year that would have positioned Kenya for political leadership in Africa. Instead, he is leading the country back toward the autocracy it thought it had left behind. By shutting down media, ignoring court orders and charging peaceful opponents with treason, he is dangerously raising tensions in an already polarized society and inviting ostracism for his government.

Mr. Kenyatta appeared to handily win a presidential election last August against longtime opponent Raila Odinga, but then accepted a ruling by the supreme court invalidating the vote because of procedural irregularities. So far, so good: Mr. Kenyatta could have fixed the problems with the voting process, ensured a free and fair vote, and defeated Mr. Odinga again. Instead, he embarked on a vindictive campaign, sponsoring legislation to prevent the supreme court from censuring future elections and intimidating electoral officials, one of whom fled the country. Mr. Odinga and his supporters ended up boycotting the election, depriving Mr. Kenyatta of a convincing mandate.

The situation deteriorated further last week when Mr. Odinga elected to stage a demonstration in which he swore himself in as the “people’s president.” It was a political stunt that, had Mr. Kenyatta ignored it, would have served only to discredit Mr. Odinga. Instead, the president warned Kenyan television stations not to cover the event, then shut down four of them when they did. That was a clear violation of the country’s constitution, and when a court ordered the stations reopened, the government did not respond. Only on Monday, four days after the court order, were two of the stations allowed back on the air, and there were reports that they had been forced to agree to coverage restrictions.

Mr. Kenyatta meanwhile launched a campaign against key supporters of Mr. Odinga. Lawyer Miguna Miguna was arrested in his home on Friday and held incommunicado over the weekend even after a court ordered his release. On Tuesday he was brought before a court outside Nairobi and charged with the crime of attending Mr. Odinga’s mock inauguration, which was characterized as “a capital offense, namely treason.” The passports of 14 other opposition leaders were suspended.

The wave of repression has prompted demonstrations among Mr. Odinga’s supporters in the Luo community. It risks reigniting ethnic violence that killed more than 1,000 people following a 2007 presidential election. That tragedy led to important constitutional and other democratic reforms that Mr. Kenyatta is disregarding.

Kenya’s African neighbors and Western donors ought to be demanding that the president reverse course before it is too late. Last week the State Department issued a statement criticizing both Mr. Odinga’s auto-inauguration and the shutdown of television stations. It urged Kenya’s leaders to begin “a national conversation” about “long-standing issues.” That’s a good idea, but it can’t happen if Mr. Kenyatta continues his unlawful crackdown. The Trump administration should warn him of U.S. punitive actions, including sanctions, if he does not stop.

Read more here: