Heidelberg can trace its beginnings to the fifth century. The village Bergheim ("Mountain Home") is first mentioned for that period in documents dated to 769 AD. Bergheim now lies in the middle of modern Heidelberg. The people gradually converted to Christianity. In 870 AD, the monastery of St. Michael was founded on the Heiligenberg inside the double rampart of the Celtic fortress. Around 1130, the Neuburg Monastery was founded in the Neckar valley. At the same time, the bishopric of Worms extended its influence into the valley, founding Schönau Abbey in 1142. Modern Heidelberg can trace its roots to this 12th-century monastery. The first reference to Heidelberg can be found in a document in Schönau Abbey dated to 1196. This is considered to be the town's founding date. In 1156, Heidelberg castle and its neighboring settlement were taken over by the house of Hohenstaufen. Conrad of Hohenstaufen became Count Palatine of the Rhine (). In 1195, the Electorate of the Palatinate passed to the House of Welf through marriage. In 1214, Ludwig I, Duke of Bavaria acquired the Palatinate, as a consequence of which the castle came under his control. By 1303, another castle had been constructed for defense. In 1356, the Counts Palatine were granted far-reaching rights in the Golden Bull, in addition to becoming Electors. In 1386, Heidelberg University was founded by Rupert I, Elector Palatine. Modern history Heidelberg University played a leading part in Medieval Scholasticism, Renaissance humanism, the German Reformation, and in the subsequent conflict between Lutheranism and Calvinism during the 15th and 16th centuries. In April 1518, a few months after proclaiming his Ninety-five Theses, Martin Luther was received in Heidelberg, to defend them. Heidelberg's library, founded in 1421, is the oldest existing public library in Germany. In 1537, the castle located higher up the mountain was destroyed by a gunpowder explosion. The duke's palace was built at the site of the lower castle. Elector Frederick III, sovereign of the Electoral Palatinate from 1559 to 1576, commissioned the composition of a new Catechism for his territory. While the catechism's introduction credits the "entire theological faculty here" (at the University of Heidelberg) and "all the superintendents and prominent servants of the church" for the composition of the Catechism, Zacharius Ursinus is commonly regarded as the catechism's principal author. Caspar Olevianus (1536–1587) was formerly asserted as a co-author of the document, though this theory has been largely