King David had entered England in support of his niece, Empress Matilda, who was viewed as the rightful heiress to the English throne usurped by King Stephen. With Stephen fighting rebel barons in the south, the Scottish armies had already taken Cumberland and Northumberland, the city of Carlisle and the royal castle at Bamburgh. Finding the English in a defensive position on a hill, David elected to force a battle counting on his superior numbers, 16,000 Scots against 10,000 Englishmen. Repeated attacks by native Scots failed against the onslaught from the English archers, with losses of up to 12,000 Scots. A subsequent attack by mounted knights met initial success but fell back due to lack of infantry support. The battle ended when David's reserve deserted, forcing him to retreat. The English elected not to pursue, and despite their great losses the Scots were able to regroup in sufficient number to besiege and capture Wark Castle.