The region took its name first in the early 16th century, because it was by the Treaty of Pavia one of the main portions of the territory of the Wittelsbach Elector Palatine, who also ruled over the Lower Palatinate in the Rhineland, now normally just called the Palatinate, or Pfalz. The capital of the Upper Palatinate was Amberg. Cadet branches of the Wittelsbach also ruled over smaller territories in Neuburg and Sulzbach. As a result of the Elector Palatine Frederick V's abortive claim to the Bohemian throne in 1619-20, the Upper Palatinate, along with the rest of his lands, were declared forfeit to the Emperor and, along with the Electoral title, given to the Duke of Bavaria. Although the Lower Palatinate was restored to Frederick's son by the Peace of Westphalia in 1648, the Upper Palatinate remained under the Elector of Bavaria, and has remained a part of Bavaria ever since. The smaller territories of Sulzbach and Neuburg came to Bavaria in 1742, while the city of Regensburg, an Imperial Free City, was not joined with the rest of the region until the end of the Holy Roman Empire in 1806.