In 1313, James II of Aragon granted administrative and political autonomy to the Aran Valley, the legal details of which are described in a Latin manuscript called the Querimonia. The devolution of power was a reward for the Aranese pledging allegiance to James II in a dispute with the kingdoms of France and Mallorca over control of the valley. This situation was suppressed in 1834, when the Valley was integrated into the new Province of Lleida, in the context of creation of the liberal state.