Before his departing the capital Chang'an to report to Liang Province, Emperor Wen personally visited Dou Kang and Princess Ancheng.
In 604, Emperor Wen died—a death that traditional historians generally believe to be a murder ordered by his son and crown prince Yang Guang, although they admitted a lack of direct evidence.
Toward the end of Emperor Yang's reign, Dou was commissioned with an army at Lingwu to secure the northern border.
Soon thereafter, Emperor Yang was killed in a coup at Jiangdu (江都, in modern Yangzhou, Jiangsu) led by the general Yuwen Huaji.
When the news reached Chang'an, Li Yuan had Yang You yield the throne to him, establishing Tang dynasty as its Emperor Gaozu.
Dou Kang, who was then the minister of engineering, was given the additional title of Nayan (納言), the head of the examination bureau of the government and a post considered to be one for a chancellor.