To protect his Biržai lands and Lithuania's northern border, Prince Krzysztof Radziwiłł (1547–1603) built in Biržai a modern Italian-style bastion fortress, the largest and strongest in Lithuania at the time. Work began in 1575 with the construction of a dam at the confluence of the Apaščia and Agluona rivers. In 1586–1589 the ramparts were raised, and a representative palace, an Evangelical Reformed church, an arsenal, food stores, barracks and other buildings were built. The fortress and the town formed a single defensive complex. The fortress was completed in 1589. Sigismund Vasa, Grand Duke of Lithuania and King of Poland, and later his descendants, who did not give up their claims to the Swedish throne, drew Lithuania and Poland into long wars with Sweden (1600–1635 and 1655–1660), during which the Swedes damaged the fortress in 1625. On the initiative of Prince Krzysztof II Radziwiłł, major work to remodel the fortress began in 1637. This was not only a restoration of the castle but a rebuilding: the type of fortification changed, with the Dutch type used instead of the Italian, its main feature being earth ramparts and bastions encircling the fortress. In 1640 Janusz Radziwiłł (1612–1655), son of Krzysztof II and future Grand Hetman of Lithuania, inherited Biržai and continued the reconstruction of Biržai Castle. In autumn 1655 the Biržai fortress again fell to the Swedes. In 1659 the castle was recaptured by Janusz Radziwiłł's cousin, Prince Bogusław Radziwiłł (1620–1669). Although he lived in Königsberg, he took care of rebuilding the Biržai fortress, left unfinished because of the wars; a general plan of the fortress was drawn up in 1662, but when Bogusław Radziwiłł, the last male descendant of the Biržai–Dubingiai branch of the Radziwiłłs, died in 1669, construction of the castle stopped. In his will Bogusław Radziwiłł left all his property to his daughter Ludwika Karolina (1667–1695). Ludwika Karolina resumed the construction of the fortress in 1671, and the work lasted until 1682. This fortress was considerably larger than the first. The palace, the fortifications and 21 buildings formed a huge defensive complex. During the Great Northern War (1700–1721), on 26 February 1701 in Biržai, Russian Tsar Peter I and Augustus II, King of Poland-Lithuania, concluded a treaty against Sweden. In August of the same year the Swedes took Biržai, and it was only in 1703 that it was recaptured. On 14 September 1704 the army of the Swedish general A. L. Lewenhaupt took the fortress again. As they withdrew, the Swedes blew up the palace and other buildings of the fortress. The representative palace of Biržai Castle was rebuilt in 1978–1988; the Biržai Public Library moved into it in 1988, and the Biržai Regional Museum "Sėla" in 1989. Of the Dutch-type bastion fortress complex built by the Radziwiłł princes, which defended Lithuania's northern border in the 17th–18th centuries, besides the representative palace two powder magazines and a bridge have been rebuilt, and the arsenal building has now also been reconstructed.