Some time later Ruairi took for his third wife a daughter of Hector Og Maclean of Duart, and had by her two sons, Torquil Dubh and Tormod. Ruairi also had several natural sons, Tormod Uigach and Murdoch. Ruairi then made Torquil Dubh his heir, and again Torquil Connanach took up arms supported by the Mackenzies. Ruairi was aided by several of his illegitimate sons, including Donald, Ruairi Og and Niall, though two others, Tormod "Uigach" (from Uig, Lewis) and Murdoch aided Torquil Connanach. In the encounter that followed Ruairi was again captured, and many of his men were killed. Upon Torquil Connanach's victory all charters and title deeds of Lewis were handed over to the Mackenzies. Ruairi was held captive in the castle of Stornoway, commanded by Torquil Connanach's son John, though was freed when Ruairi Og attacked the castle and killed John. Upon his release Ruairi ruled Lewis in peace for the rest of his life.