Tesla chief executive Elon Musk said the electric-car maker will build its first European factory as well as an engineering and design centre in Berlin.
By building a plant in Germany, Tesla will be able to add the "Made in Germany" accolade.
Berlin also has earmarked financial support for manufacturing electric car battery cells.
Musk, in a tweet, said that Tesla will build batteries, powertrains and vehicles, starting with Model Y lower-priced sports utility vehicle at the Berlin factory.
Last month, Tesla said it expected its European factory to start production in 2021. The carmaker is also gearing up to open its factory in Shanghai.
Musk made the announcement about the Berlin plant at the Golden Steering Wheel awards ceremony in Germany.
He said the factory will be near the new Berlin airport.
Musk had said in June last year that Germany was the frontrunner for its first factory in Europe.
"Tesla is coming to Brandenburg with a big investment," Dietmar Woidke, state premier of Brandenburg, said in a statement. "We lobbied for this for a long time in intensive talks and with good arguments."
Tesla is yet to prove it can be consistently profitable. It has said it expects to be cash flow positive, but faces big investments with the launch of new factories and development of products including a pickup truck and a semi-truck.
Musk's appearance at the awards ceremony is another example of Tesla's efforts to co-opt marketing tactics employed by German manufacturers, which have a reputation for quality.
Tesla, for instance, has tested its cars on the Nordschleife, the notorious northern loop of the Nuerburgring racing track, as a way to burnish the brand's reputation for reliability and sporting prowess.
The company has an engineering firm in Pruem, Germany, that specialises in automated manufacturing systems for battery-making plants.
In October, Reuters reported that Tesla is aiming to start production for its factory in China amid uncertainties around orders, labour and suppliers.
Berlin's gain is Britain's loss
Britain missed its chance to host Tesla's first European factory because of Brexit, according to Mr Musk.
"Brexit (uncertainty) made it too risky to put a Gigafactory in the UK," Mr Musk told industry website Auto Express.
No one from Tesla was immediately available to comment.
Berlin's minister in charge of economic affairs, Ramona Pop, said the move could create 6,000 to 7,000 jobs in production alone, with hundreds or even thousands more in areas such as design, software or research.