Complex sentence: The castle was damaged during the Northern War and was dismantled during the 18th century, later (at the beginning of 19th century) an observatory was built on the site.
Split into simpler sentences: The castle was damaged during the Northern War and was dismantled during the 18th century. Later (at the beginning of 19th century) an observatory was built on the site.