Modern 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. The people gradually converted to Christianity. In 863 AD, the monastery of St. Michael was founded on the Heiligenberg inside the double rampart of the Celtic fortress. 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 1155, Heidelberg castle and its neighboring settlement were taken over by the house of Hohenstaufen.

Heidelberg University played a leading part in the era of humanism and the Reformation, and the conflict between Lutheranism and Calvinism, in the 15th and 16th centuries. Heidelberg's library, founded in 1421, is the oldest existing public library in Germany. In April 1518, a few months after proclaiming his 95 Theses, Martin Luther was received in Heidelberg, to defend them. 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.

During the Nazi period (1933–1945), Heidelberg was a stronghold of the National Socialist German Workers' Party the strongest party in the elections before 1933. Non-Aryan university staff were discriminated against. By 1939, one-third of the university's teaching staff had been forced out for racial and political reasons. The non-Aryan professors were ejected in 1933, within one month of Hitler's rise to power.

In 1934 and 1935, the Reichsarbeitsdienst (State Labor Service) and Heidelberg University students built the huge Thingstätte amphitheatre on the Heiligenberg north of the town, for Nazi Party and SS events.

During the Kristallnacht on November 9, 1938, Nazis burned down synagogues at two locations in the city. The next day, they started the systematic deportation of Jews. On March 29, 1945, German troops left the city after destroying three arches of the old bridge, Heidelberg's treasured river crossing. They also destroyed the more modern bridge downstream. The U.S. Army (63rd Infantry, 7th Army) entered the town on March 30, 1945. The civilian population surrendered without resistance.

A popular belief is that Heidelberg escaped bombing in World War II because the U.S. Army wanted to use the city as a garrison after the war. As Heidelberg was neither an industrial center nor a transport hub, it did not present a target of opportunity. Other notable university towns, such as Tübingen and Göttingen, were spared bombing as well. Allied air raids focused extensively on the nearby industrial cities of Mannheim and Ludwigshafen.

The U.S. Army may have chosen Heidelberg as a garrison base because of its excellent infrastructure, including the Heidelberg-Mannheim Autobahn (motorway), which connected to the Mannheim-Darmstadt-Frankfurt Autobahn, and the U.S. Army installations in Mannheim and Frankfurt. The intact rail infrastructure was more important in the late 1940s and early 1950s when most heavy loads were still carried by train, not by lorry. Heidelberg had the untouched Wehrmacht barracks, the "Grossdeutschland Kaserne" which the US Army occupied soon after, renaming it the Campbell Barracks.
This gallery is empty.