 The brothers remained in prison in Pleissenburg and Königstein for two years before finally being released after the Treaty of Altranstädt where he signed a formal agreement to never again make any attempt to become King of Poland.James Sobieski received a favorable sentence during the Silent Sejm in 1717, which enabled him to return to the Polish-Lithuanian Commonwealth and recover his family property which had been confiscated by King Augustus.He returned to Poland and reconciled with the king, and subsequently settled in the Sobieski's ancestral castle in Żółkiew.