In a report from the Beijing Press and Publishing Bureau, the largest contract, worth 15m renminbi (£1.25m), went to domestic office automation and antivirus software vendor Kingsoft Software.
Kingsoft hailed the municipal government's role in promoting intellectual property rights. The move will popularise and foster legal use of software, the company said in a statement.
Linux developer Red Flag Software won another one of the contracts.
"The government, like most other software buyers, would consider the price, product and performance of the software, and I think local companies have the edge because we can provide better and more immediate service," said Liu Bo, chief executive officer and president of Red Flag.
The Linux operating system has been increasingly popular in China, mostly due to strong government support of the open source environment, and will continue to see greater adoption due to this latest endorsement by the municipal government, according to Bo.
"Microsoft still has the monopoly over desktop PCs and Linux has a long way to go," he said, adding that the openness of the Linux platform makes it a popular choice in China.
Although Microsoft has more than an 80% share of the desktop PC market on the Chinese mainland, the impact of its loss in the software tender process may be more profound in the long run, according to Louisa Liu, a Shanghai-based analyst with analyst group Gartner.
"It has great impact on the later purchases of the other departments of the State," said Liu. "In the short term, it won't affect Microsoft much. However, if Microsoft can't deal well with the Chinese government agencies it will face some headaches in its mid to long term expansion plans in China."
The Beijing municipal government has purchased operating system, office automation, and antivirus software to replace pirated software in more than 60 departments and agencies it controls in the Chinese capital.