 After a siege of his castle in Gotha in 1566, John Frederick was eventually defeated and spent the rest of his life as an imperial prisoner.His possessions were confiscated by the emperor and handed over to John William, who became the sole ruler of the whole duchy of Saxony.In Weimar on 26 May 1555 John Frederick II married his first wife Agnes of Hesse, Dowager Electress of Saxony.