The monks of Shaolin allied with Wang's enemy, Li Shimin, and took back the Cypress Valley Estate, defeating Wang's troops and capturing his nephew Renze. Without the fort at Cypress Valley, there was nothing to keep Li Shimin from marching on Luoyang after his defeat of Wang's ally Dou Jiande at the Battle of Hulao, forcing Wang Shichong to surrender. Li Shimin's father was the first Tang Emperor and Shimin himself became its second. Thereafter Shaolin enjoyed the royal patronage of the Tang.