In 1808 he was sent to serve in Spain where he fought in the Peninsular War until 1812.
This passage describes a person who was sent to Spain in 1808 and remained there until 1812 during the Peninsular War.