Das Königlische Schloß zu Potsdam von der langen Brücke.
In 1745, as part of the complex web of alliances involved in the Silesian Wars, Prussian forces attacked Leipzig, and although the City Fathers prudently saved their city by surrendering, Prussian forces briefly occupied the city garrison, departing on New Year's Day 1746. The city itself, and Saxony overall, were forced to pay heavy financial “reparations” for being on the “wrong side”.
Although Bach had received several Royal Requests to visit King Frederick the Great of Prussia in Potsdam, conveyed through his son Carl Phillip Emmanuel who was employed as Court Harpsichordist there, Bach would naturally feel that in view of recent hostilities such a visit would not be well received in Leipzig. After putting off the visit by pleading ill-health, in 1747 Bach finally made the long, 20-hour journey from Leipzig to attend at the Royal Palace in Potsdam.
The King and his Capelle normally played chamber music between 7 and 9 pm. The story, well documented in contemporary newspapers, recounts that on Bach's arrival, Frederick was about to begin his evening concert, in which he himself played the flute with the orchestra. He was given the list of people who had arrived at Court, and, laying down his flute, he said to his orchestra, 'Gentlemen, old Bach is here'. He then canceled his evening concert and invited Bach straight up to try his new fortepianos built by Bach's organ-builder colleague and friend Gottfried Silbermann. The King owned seven of these instruments, located in different rooms.
After Bach had played on all the different instruments, moving with the King and musicians from room to room, Bach invited the King to give him a theme on which to improvise. The king promptly did so, and Bach of course rose to the occasion, improvising at length and with amazing skill, as contemporary reports also relate. On his return to Leipzig, to show his gratitude for the excellent reception he had received at Potsdam, Bach developed the King's theme into a sequence of complex contrapuntal movements, added a sonata for violin and flute (Frederick being a flute-player), entitled the whole 'A Musical Offering' and sent it to the Court with a florid letter of dedication.
The Palace was destroyed during World War II. Though dating from the early 1800s, this print shows the Palace at Potsdam as it would have been at the time of Bach's visit. The view is taken from the Long Bridge; we see the side view, the main front facade and entrance being to the left in the print.
The King's Summer Palace, called Sanssouci ('Without Care'), situated in the Royal Park nearby, had been completed and dedicated on May 1st, 1747, just prior to Bach's visit; it is still standing and open to visitors.