The legal system is a mixture of Civil and Common law, influenced by the prior rule of both Spain and the United States. Spanish rule relied heavily on local intermediaries, setting up a system dominated by elites. A revolution that emerged near the end of Spanish rule was defeated by the United States, who consolidated power over the entirety of the archipelago. American rule led to the introduction of democracy, and institutions patterned on the American political system. Following independence in 1946, national politics took place within a two-party system. This was disrupted by the establishment of a dictatorship under martial law. Changes following the restoration of democracy led to the current multi-party system. Left-wing insurgencies have existed at various strengths since independence, and a long-running Islamic insurgency contributed to the establishment of an autonomous Muslim region with a limited sharia law system.