 Around the new year 557, Yuwen Hu forced Emperor Gong of Western Wei to yield the throne to Yuwen Jue, ending Western Wei and founding Northern Zhou, with Yuwen Jue taking the throne as Emperor Xiaomin, but with the alternative title of "Heavenly Prince" ("Tian Wang").Wei was made the deputy minister of the interior.After Yuwen Hu removed and killed Emperor Xiaomin later in 557 and replaced him with another son of Yuwen Tai, Yuwen Yu the Duke of Ningdu (as Emperor Ming), Wei took on the additional responsibility as an imperial researcher.