Mr Musk said the firm would also build an engineering and design centre in the German capital.
Tesla previously said it aimed to start production in Europe in 2021.
The moves come as the firm, which has also invested heavily in a Chinese factory, faces intensifying competition in the electric vehicle industry.
Mr Musk made the announcement at an awards ceremony in Germany on Tuesday.
"Everyone knows that German engineering is outstanding and that's part of the reason we are locating our Gigafactory Europe in Germany," he said.
Mr Musk said the facility would be located near the new Berlin airport and later gave more details on what the factory would produce on Twitter.
The focus on Germany comes amid rising appetite for electric cars in Europe.
Over the coming years, the biggest electric car production plants will be in Germany, France, Spain and Italy, industry analysis showed.
Some 16 large-scale lithium-ion battery cell plants are confirmed or due to begin operations in Europe by 2023.