Northumbria became an earldom when the southern part of Northumbria (which had been Deira) was lost to the Danelaw.[6] The northern part (which had been Bernicia) was a kingdom for a short time but under the Danish kingdom it also became an earldom. Some of this land was claimed by both England and Scotland. The Earldom of Northumbria was later a part of England by the Anglo-Scottish Treaty of York in 1237. On the northern border, Berwick-upon-Tweed, which is north of the Tweed but had changed hands many times, was defined as subject to the laws of England by the Wales and Berwick Act 1746. The land once part of Northumbria at its peak is now divided by modern administrative boundaries: