 the Golden Freedoms.Eventually, in 1569, after Sigismund II Augustus transferred significant territories of the Grand Duchy to Poland and after months of hard negotiations, Lithuanians partially accepted Polish demands and entered in alliance with the Union of Lublin, forming the Polish–Lithuanian Commonwealth.In the next phase of the conflict, in 1577, Ivan IV took advantage of the Commonwealth's internal strife (called the war against Danzig in Polish historiography), and, during the reign of Stefan Batory in Polish–Lithuanian Commonwealth, invaded Livonia, quickly taking almost the entire territory, with the exception of Riga and Reval (now Tallinn).