Complex sentence: The castle dates back to the 10th century, when it served as a lookout post and fortress.
Split into simpler sentences: The castle dates back to the 10th century. It served as a lookout post and fortress.