 Charles IV's vacillation, culminating in his failure to honour the alliance by neglecting to enforce the Continental System, led to the invasion of Spain in 1808 under Napoleon I, Emperor of the French, thereby triggering the Peninsular War, with enormous human and property losses, and loss of control over most of the overseas empire.During most of the 18th century Spain had arrested its relative decline of the latter part of the 17th century.But despite the progress, it continued to lag in the political and mercantile developments then transforming other parts of Europe, most notably in Great Britain, the Low Countries, and France.