James II, Count of Urgell

James II (in Catalan Jaume II d'Urgell or Jaume el Dissortat "James the unlucky", in Spanish Jaime II el desafortunado) (1380 – 1 June 1433) was the Count of Urgell (1408–1413), Viscount of Àger, and lord of Antillón, Alcolea de Cinca, and Fraga. Scion of a younger branch of the House of Barcelona and its last male member, he was the centre of opposition to the House of Trastámara after it succeeded to the Crown of Aragon in 1412.

Born at Balaguer to Peter II of Urgell and Margaret Palaiologue of Montferrat, James inherited the county of Urgell from his father in 1408. In Valencia on 29 June 1407, he had married Isabella, daughter of Peter IV of Aragon, who appointed him lieutenant of the Kingdom of Aragon in 1408.

Following the death in 1409 of Martin the Younger, heir to the Aragonese Crown, the king appointed James governor-general, an act interpreted by James as implying his heirdom. Following the death of the king in 1410, however, James was one of the six candidates who claimed the throne. Succession through the male line, as ordained in the will of James I of Aragon, would have given him the crown, but through the Compromise of Caspe, Ferdinand of Antequera was elected instead.

Influenced by his mother, Margaret of Montferrat, and by Antón de Luna, James II of Urgell refused to recognise Ferdinand as king and took up arms against him. Defeated at Castefrorite and Montearagón, James took refuge in the castle of Balaguer which was under siege by the royal troops. He surrendered on 31 October 1413 and was imprisoned in Teruel and then Xàtiva where he died twenty years later.

Marriage and issue
James and Isabella had:
 * Isabella (1409–1430), married Peter, Duke of Coimbra, in 1428
 * Eleanor (1414–1438), married Raimon Orsini in 1436;
 * Joanna (1415–1455), married John I, Count of Foix in 1435 and, then, remarried Joan Ramon Folc III de Cardona in 1445; had three children, including Juan Ramón Folc IV de Cardona, the first Duke of Cardona.
 * Philip, who died around 1422 while still young;
 * Catherine, who also died young, not long after Philip (c. 1424).