Bauska Castle, in Latvia, is actually a castle and a palace. The castle was built by Teutonic Knights over a period of about a hundred years in the 15th and 16th centuries. But in the late 16th century, the Livonian branch of the Teutonic Order collapsed, and the castle became the property of the Dukes of Courland, who built the adjoining palace.
Both castle and palace were destroyed in 1702 during the Great Northern War.
These days, the castles is in ruins, but the palace has been restored. Both are open to visitors - you can climb to the top of the castle watchtower for a good view of the surrounding countryside.