Complex sentence: The Spanish attacked at 19:30, when the last thing the patriots expected was a battle, the result was a huge retreat of the rebels, who took revenge in the Battle of Maipu.
Split into simpler sentences: The Spanish attacked at 19:30, when the last thing the patriots expected was a battle. The result was a huge retreat of the rebels, who took revenge in the Battle of Maipu.