The moves shows its willingness to bend on prices to keep key accounts for its Windows operating system moving into the open-source Linux camp.
The licensing agreement will save federal, state and local governments "much money", interior minister Otto Schily said in the statement.
The agreement comes after Microsoft chief executive officer Steve Ballmer paid a visit to government officials in Germany.
Microsoft has been scrambling to find ways to retain huge public sector software contracts in Germany ever since the German government, in an effort to lower costs and increase security, agreed last year to a partnership with IBM for the delivery of computers with the open-source Linux operating system to federal, state and local governments.
The German government is keen to have Microsoft products coexist with rival products. "Our strategy is to combine the world of the commercial software companies with the world of open-source providers," Schily said.
Under the agreement, German government agencies can acquire Microsoft software at favourable rates without having to commit themselves to using the company's products exclusively, the ministry said in the statement.
Microsoft has also agreed to publish specifications for interfaces and data formats, in addition to supporting open standards in its products. These assurances will give the agencies greater flexibility in building their IT systems, it said.