After enthronement of the Emperor Junna, he was called back to the capital and worked actively as a close aide to the Emperor Junna and, in 825, he was appointed to the kurodo no to (chief official of the emperor's secretaries) and helped the Emperor Junna in executing his policies.
淳和天皇の即位後は都に呼び戻されて側近として活躍し、天長3年（825年）に蔵人頭となって天皇の政策を助けた。