The Austrian full-back, who joined Bayern's youth academy from Austria Vienna in 2008, has risen through the ranks over the recent years, cementing a place in the European champions' first team.
The 21-year-old has featured heavily in Bayern's impressive start to the 2013/14 season, helping the Bundesliga giants to top spot in the league as well as securing a Champions League record of 10 consecutive victories.
Upon the announcement, Bayern Munich's chief executive Karl-Heinz Rumenigge expressed his joy at the deal.
"We are very happy that it has led to this very nice agreement for both sides," Rumenigge said.
"David has undergone amazing development. He is already among Europe's best and most successful full backs."
Bayern announced the news on their official Twitter account.