Tradition holds that Charles the Great (Charlemagne) granted a charter to the Andorran people in return for fighting against the Moors. Overlordship of the territory was by the Count of Urgell and eventually by the bishop of the Diocese of Urgell. In 988, Borrell II, Count of Urgell, gave the Andorran valleys to the Diocese of Urgell in exchange for land in Cerdanya. Since then the Bishop of Urgell, based in Seu d'Urgell, has owned Andorra.
Before 1095, Andorra did not have any type of military protection and the Bishop of Urgell, who knew that the Count of Urgell wanted to reclaim the Andorran valleys, asked for help and protection from the Lord of Caboet. In 1095, the Lord of Caboet and the Bishop of Urgell signed under oath a declaration of their co-sovereignty over Andorra. Arnalda, daughter of Arnau of Caboet, married the Viscount of Castellbò and both became Viscounts of Castellbò and Cerdanya. Years later their daughter, Ermessenda, married Roger Bernat II, the French Count of Foix. They became Roger Bernat II and Ermessenda I, Counts of Foix, Viscounts of Castellbò and Cerdanya, and also co-sovereigns of Andorra (shared with the Bishop of Urgell).
In the eleventh century, a dispute arose between the Bishop of Urgell and the Count of Foix. The conflict was resolved in 1278 with the mediation of Aragon by the signing of the first paréage which provided that Andorra's sovereignty be shared between the count of Foix (whose title would ultimately transfer to the French head of state) and the Bishop of Urgell, in Catalonia. This gave the principality its territory and political form.
Over the years, the French co-title to Andorra passed to the kings of Navarre. After Henry of Navarre became King Henry IV of France, he issued an edict in 1607 that established the head of the French state and the Bishop of Urgell as co-princes of Andorra. In 1812–13, the First French Empire annexed Catalonia and divided it in four départements, with Andorra being made part of the district of Puigcerdà (département of Sègre).
Andorra declared war on Imperial Germany during World War I, but did not actually take part in the fighting. It remained in an official state of belligerency until 1957 as it was not included in the Treaty of Versailles.
In 1933, France occupied Andorra as a result of social unrest before elections. On July 12, 1934, adventurer Boris Skossyreff was proclaimed by the Parliament King and Sovereign of Andorra, simultaneously declaring war on the Bishop of Urgell. King Boris I of Andorra was arrested by Spanish authorities on July 20 and ultimately expelled from Spain. From 1936 to 1940, a French detachment was garrisoned in Andorra to prevent influences of the Spanish Civil War and Franco's Spain. Francoist troops reached the Andorran border in the later stages of the war. During World War II, Andorra remained neutral and was an important smuggling route between Vichy France and Spain.
Given its relative isolation, Andorra has existed outside the mainstream of European history, with few ties to countries other than France and Spain. In recent times, however, its thriving tourist industry along with developments in transport and communications have removed the country from its isolation. Its political system was modernised in 1993, when it became a member of the United Nations and the Council of Europe.
Andorra is a parliamentary co-principality with the President of France and the Bishop of Urgell (Catalonia, Spain), as co-princes. This peculiarity makes the President of France, in his capacity as Prince of Andorra, an elected reigning monarch, even though he is not elected by a popular vote of the Andorran people. The politics of Andorra take place in a framework of a parliamentary representative democracy, whereby the Prime Minister of Andorra is the head of government, and of a pluriform multi-party system.
The Parliament of Andorra is known as the General Council. The General Council consists of between 28 and 42 Councilors, as the members of the legislative branch are called. The Councilors serve for four-year terms and elections are held between the thirtieth and fortieth days following the dissolution of the previous Council. The Councilors can be elected on two equal constituencies.
Half are elected in equal number from each of the seven administrative parishes and the other half of the Councilors are elected from a single national constituency. Fifteen days after the election, the Councilors hold their inauguration. During this session, the Syndic General, who is the head of the General Council, and the Subsyndic General, his assistant, are elected. Eight days later, the Council convenes once more. During this session the Head of Government, the Prime Minister of Andorra, is chosen from among the Councilors.
Candidates for the prime-ministerial nomination can be proposed by a minimum of one-fifth of the Councilors. The Council then elects the candidate with the absolute majority of votes to be Head of Government. The Syndic General then notifies the Co-princes who in turn appoint the elected candidate as the Prime Minister of Andorra. The General Council is also responsible for proposing and passing laws. Bills may be presented to the Council as Private Members' Bills by three of the Local Parish Councils jointly or by at least one tenth of the citizens of Andorra.
The Council also approves the annual budget of the principality. The government must submit the proposed budget for parliamentary approval at least two months before the previous budget expires. If the budget is not approved by the first day of the next year, the previous budget is extended until a new one is approved. Once any bill is approved, the Syndic General is responsible for presenting it to the Co-princes so that they may sign and enact it.
If the Head of Government is not satisfied with the Council, he may request that the Co-princes dissolve the Council and order new elections. In turn, the Councilors have the power to remove the Head of Government from office. After a motion of censure is approved by at least one-fifth of the Councilors, the Council will vote and if it receives the absolute majority of votes, the Prime Minister is removed.