In June 1963, as the Cold War raged, President John F. Kennedy traveled to Germany to denounce communism and express U.S. support for the people there, whose country had been divvied up after World War II. His address in West Berlin, where he declared "Ich bin ein Berliner," struck a chord with the massive crowd, making it one of his most-remembered speeches.

After World War II, the victorious Allied powers divided Germany into four zones. Three of those—controlled by the United States, the United Kingdom and France, respectively—became democratic West Germany, whereas the one controlled by the Soviet Union became communist East Germany.

Berlin, the former capital, was similarly split despite being located squarely within East Germany’s borders, a situation that rankled the Soviet Union. In June 1948, the USSR cut off all land and water routes between West Berlin and the rest of West Germany in an attempt to gain control over the city. But the United States and its allies were able to overcome this 11-month blockade by airlifting in over 2.3 million tons of food and supplies.

Berlin remained a point of contention between the United States and the Soviet Union when Kennedy took office in January 1961. At a summit that June in Austria, Soviet leader Nikita Khrushchev threatened the sovereignty of West Berlin and ratcheted up the rhetoric, warning that it was “…up to the U.S. to decide whether there will be war or peace” between the two nations and insisting that as the Cold War heated up, “Force will be met by force.”

“Worst thing in my life,” Kennedy told a New York Times reporter afterwards. “He savaged me.”

Khrushchev then approved the construction of the Berlin Wall in order to prevent any more East Germans from fleeing to the West (an estimated 3.5 million had already done so). Barbed wire went up on August 13, 1961; concrete blocks later replaced it. More turmoil came in October, when Soviet and U.S. tanks rolled to within a few hundred feet of each other at Checkpoint Charlie, the crossing point for diplomats and other non-Germans. The 16-hour standoff, which precipitated worries about a World War III, ended without any shots being fired.

On June 23, 1963, Kennedy returned to Europe for the first time since sparring with Khrushchev in Austria. He visited Bonn, Cologne and Frankfurt in West Germany, where big crowds chanted his name and waved U.S. flags, before flying into West Berlin on the morning of June 26. On the way over he showed General James H. Polk, the U.S. commandant in Berlin, a draft of the speech he planned to give later that day. “This is terrible, Mr. President,” Polk reportedly said.

Kennedy agreed and began working out a more forceful version in his head as he toured Checkpoint Charlie and other locations around the city. He also inserted a little German, which he wrote phonetically on note cards. Meanwhile, at least 120,000 West Berliners—some estimates place the total as high as 450,000—had gathered in the plaza outside city hall to hear Kennedy speak.

Early in his address, the foreign language-challenged president broke out four German words he had supposedly been practicing for days. “Two thousand years ago the proudest boast was ‘civis Romanus sum,’” Kennedy said. “Today, in the world of freedom, the proudest boast is ‘Ich bin ein Berliner.’” Legend holds that by including the article “ein,” Kennedy had called himself a jelly doughnut. But although speechwriter Ted Sorensen blamed himself for the alleged mistake in a memoir, German linguists maintain that the president used acceptable grammar.

Kennedy went on to lambaste the failures of communism, saying anyone who thought it was the wave of the future should come to Berlin. “Freedom has many difficulties and democracy is not perfect, but we have never had to put a wall up to keep our people in,” JFK stated. After praising the people of West Berlin for being at the front lines of the Cold War, he finished up by repeating his soon-to-be famous phrase. “All free men, wherever they may live, are citizens of Berlin, and, therefore, as a free man, I take pride in the words “Ich bin ein Berliner!’” he exclaimed.

The whole speech lasted only nine minutes. Kennedy then gave another address at the Free University of Berlin before flying to Ireland that evening. “We’ll never have another day like this one, as long as we live,” he reportedly said in reference to the enthusiastic crowds.

Although Kennedy was assassinated that November, his wish for the city to “be joined as one” came true when the Berlin Wall fell in November 1989. To this day he remains an admired figure in Berlin, which is hosting a series of lectures, films and exhibitions coinciding with the 50th anniversary of his visit.

HISTORY Vault: U.S. Presidents

Stream U.S. Presidents documentaries and your favorite HISTORY series, commercial-free