Complex sentence: But in 1807, Napoleon had invaded Portugal, via Spain, intent on preventing its continued trade with Britain, but replaced the Spanish royal family with his own brother, Joseph Bonaparte, in May 1808.
Split into simpler sentences: But in 1807, Napoleon had invaded Portugal, via Spain, intent on preventing its continued trade with Britain. He replaced the Spanish royal family with his own brother, Joseph Bonaparte, in May 1808.