 He took part in the planning of the Taihō Code alongside Prince Osakabe and Fujiwara no Fuhito, and in 701 was promoted to head of the Ministry of Popular Affairs.Mahito was also appointed as chief diplomat on a mission to Tang China, receiving a ceremonial sword from Emperor Tenmu as a symbol of his command.This was the first example of such a sword being bestowed, and the action would be repeated for other emissaries to Tang and for important generals.