This is the first visit to Germany by the Turkish president since 2020.
Germany's chancellor will welcome Recep Tayyip Erdogan on Friday at a challenging time in their relations.
Berlin and Ankara have often sparred over the years. But the outbreak of war between Israel and Hamas in October has placed the two firmly on opposing sides.
Olaf Scholz has backed Israel, offering to provide the country with military support.
Erdogan, whose country broadly backs the Palestinians, has accused Israel of acting like a "terrorist" state in its war against Hamas.
For Germany, where memories of the Holocaust hang heavy in the mind, receiving a leader who previously seemingly called into question the "legitimacy " of the Israeli state is a delicate balancing act.
The visit is set to be low-key. Erdogan is due to arrive in Berlin at "around noon" and then will meet his counterpart Frank-Walter Steinmeier before having a discussion with Scholz followed by dinner. A “meeting with the press” is also planned.
This is the first visit to Germany by the Turkish head of state since 2020.
When Hamas attacked Israel on 7 October, killing 1,400 people, Erdogan initially posed as a potential mediator.
But he soon took up the cause of the Palestinian militant group after Israel retaliated with a massive bombing campaign on the Gaza Strip, which has killed more than 11,000 Palestinians.
Two days before his visit to Germany, Erdogan called Israel a "terrorist state", accusing the West of "openly supporting the massacres" in Gaza, during a speech to Turkish lawmakers.
A week ago, he claimed the very legitimacy of Israel was "called into question because of its own fascism" in comments that shocked Germany.
Scholz on Tuesday called these remarks "absurd" and defended the "democratic state" of Israel against the "terrorist organization" Hamas.
Some - especially Jewish associations - have demanded the cancellation of the visit, planned for several months. The chancellor invited him after his re-election in May.
The conservative opposition said the timing of the occasion was inappropriate, along with the liberal FDP party, a member of the government coalition with Scholz's SPD and the Greens.
Despite the pressure, the government never considered cancelling.
Diplomacy requires sometimes having to discuss with "difficult partners" with whom "we must explain ourselves", said the Chancellor's spokesperson Steffen Hebestreit, recognising that discussions would be "complicated".
Germany "has no interest in quarrelling with [Erdogan] while Berlin and Ankara have recently become closer" after a period of high tension following the repression in Turkey after the 2016 coup, Der Spiegel underlined.
One reason is that Europe's largest economy is home to a large Turkish diaspora of some 2.9 million people, including 1.5 million voters who mostly support Erdogan.
Then the country, like the whole EU, needs the Turkish president to renew a 2016 pact on limiting the number of migrant arrivals, with Europe experiencing a new wave of people arriving from the Middle East that is fueling the far-right - especially in Germany.
According to this agreement, Turkey keeps migrants, mainly Syrians, on its soil, in return for a significant financial contribution.
Despite the Turkish president's authoritarianism at home, his increased influence at the geopolitical level generally makes him an essential interlocutor for Berlin.
Amid the Ukraine war, he was notably an architect of the deal guaranteeing the export of Ukrainian cereals via the Black Sea, before Moscow exited from it this summer.
Today, Western powers also see a role for Turkey in avoiding an escalation of the conflict in the Middle East, which, according to the head of German diplomacy Annalena Baerbock, makes dialogue even “more important and more urgent”.