 The king of Kucha , Haripushpa , was taken to the Tang capital as a prisoner . Execution was the punishment of rebellion in accordance with Tang law . The king was pardoned by Taizong and released after a ritual venerating the emperor 's ancestors . He was also named Great Army Commander for the Militant Guards of the Left , a title he received from the emperor . 
