Tradition holds that the country was presented a charter by Charlemagne after fighting against the Moors. It was managed first by the Count of Urgell, before being passed to the bishop of Diocese of Urgell in exchange for territory in Cerdanya in 988 AD.
Knowing that the Count of Urgell wanted the Andorran territory back, the Bishop of Urgell sought military protection from the Lord of Caboet in 1095, and a declaration was signed between the two affirming their co-ruling of Andorra.
A dispute emerged in the 11th century between the French Count Foix, an heir to the Lord of Caboet through marriage, and the Lord of Caboet. This conflict was resolved in 1278 with the signing of the Pareage of Andorra, that stated the country be shared between the two. Andorra's borders have remained unchanged since that time.
Andorra was brought under Spanish rule in 1505 when Germaine of Foix married Ferdinand V. Holy Roman Emperor Charles V then took it over in 1519.
By the early 1600s, Andorra fell under French rule when Henry IV ascended the throne, and remained as such until 1793 when the French revolutionary government renounced its reign over the territory amidst feudalism speculations.
After remaining neutral during the Napoleonic Wars in the early 1800s, Andorra petitioned Napoleon to restore the French title to the co-principality, and they were subsequently passed to the president of France. However, by 1813 Andorra was annexed and placed into the Spanish district of Puigcerda.
Although they didn't follow through with fighting during World War I, Andorra declared war on Germany, and then remained neutral during World War II (while serving as an important smuggling route between France and Spain).
In 1993 the country became a member of the United Nations followed shortly by the Council of Europe.
With duty-free shopping, gorgeous scenery and great skiing, it attracts thousands of worldwide visitors on an annual basis.