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.
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.
[3] 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 Castelflorite 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.