Following the Otenmon Incident of 866, in which Dainagon TOMO no Yoshio was overthrown and the Otomo and Ki clans, who were alleged to be involved in the event, were also ousted from the court.
貞観8年（866年）に起きた応天門の変では、大納言伴善男を失脚させ、事件に連座した大伴氏、紀氏の勢力を宮中から駆逐する。