An advance force laid siege to the town in March. Edward III and the main English army joined it in May and pressed the attack. A large Scottish army advanced to relieve the town. After unsuccessfully manoeuvring for position and knowing that Berwick was on the verge of surrender, the Scots felt compelled to attack the English at Halidon Hill on 19 July. The Scots suffered a crushing defeat, and Berwick surrendered on terms the next day. Balliol was reinstalled as king of Scotland after ceding a large part of his territory to Edward III and agreeing to do homage for the balance.