Deputy spokesman Georg Streiter told a regular news briefing that Obama would stop in Berlin on June 18-19, after a G8 summit in Northern Ireland.
"The US President Barack Obama will come to Berlin for an official visit on the invitation of the chancellor. Details on this working visit will be provided as soon as they are available," he said.
"The chancellor is very much looking forward to this visit and the talks with the president and his delegation which will cover a broad range of bilateral and global issues including the further deepening of the transatlantic relationship."
The European Union and the United States intend to begin talks within months on an ambitious transatlantic free trade deal that would create the world's largest free trade area, aimed at boosting economic growth and jobs.
Meanwhile the United States and Germany, Europe's top economy, have clashed repeatedly over fiscal strategy with Washington accusing Berlin of slowing down a global recovery with its focus on belt-tightening in Europe.
Germany responds that runaway deficit spending sparked the crisis and that budgetary discipline is the only road to sustainable economic growth.
The dispute is expected to figure prominently at the G8 meeting on June 17-18.
Obama's Berlin visit will come one week before commemorations of US President John F. Kennedy's "Ich bin ein Berliner" speech pledging US solidarity during the Cold War with the embattled city on June 26, 1963.
Officials in Berlin had long complained that Obama did not visit the German capital during his first term in office.
The Democrat laid out his foreign-policy vision in a speech in Berlin's city centre as a candidate for the White House in 2008 before 200,000 people.
He has visited Germany twice as president, the first time for a NATO summit in April 2009 in the southwestern towns of Baden-Baden and Kehl.
In June of that year, he visited the former Nazi concentration camp Buchenwald with Merkel and held talks with her in the eastern city of Dresden, where they quashed rumours of a personal rift between them at a joint press conference.
He also visited wounded soldiers at the the US military hospital in Landstuhl, western Germany.