I knew the 'poem', "First they came for the Socialists", but didn't know the man
In 1920, Niemöller began seminary training at the University of Münster. He was ordained as a Lutheran pastor in 1924. During the 1920s and early 1930s, he participated in right-wing and antisemitic political parties and organizations.
In keeping with his right-wing, antisemitic outlook, Niemöller enthusiastically welcomed the Nazi regime in 1933. He voted for the Nazi Party in March of that year.
Niemöllers enthusiasm for the new government led by Adolf Hitler quickly waned, however, when the Nazi regime began to interfere in church policy. In 1933, Hitler threw his support behind a radical faction within the Protestant churches known as the Deutsche Christen (in English, the German Christians). The German Christians portrayed Jesus as an Aryan and denied that he was Jewish. They rejected the authority of the Old Testament and sought to alter parts of the New Testament. Their goal was to remove what they called Jewish elements from Christianity. This included prohibiting pastors with Jewish ancestry from serving in the Protestant church. Niemöller led the opposition to the German Christians and Hitlers church policy.
Niemöller's attitude toward the Nazi regime further transformed in January 1934 after a meeting with Adolf Hitler. Niemöller and other prominent Protestant church leaders met Hitler to discuss the relationship between church and state. At this meeting, it became clear that the Gestapo (the Secret State Police) had tapped Niemöller's phone. The Pastors Emergency League (Pfarrernotbund), which Niemöller had helped found in 1933, was also under close state surveillance. Hitler's hostility made it clear to Niemöller that the Protestant Church and the Nazi state could not be reconciled unless Protestants were willing to compromise their faith. Niemöller was not willing to do this.
As a result, Niemöller became an outspoken critic of Nazi church policy. On July 1, 1937, the Gestapo arrested and imprisoned him as a political prisoner for the next eight years. A number of international religious leaders made calls for his release. However, Niemöller was not freed until May 1945, when the Allies defeated Nazi Germany and liberated him and other concentration camp prisoners.
https://encyclopedia.ushmm.org/content/en/article/martin-niemoeller-first-they-came-for-the-socialists