The results bring foreign investment for the first seven months of the year down to 0.35% lower than the same period last year, after the figure slowed to 0.2% year-on-year in June, state-run news agency Xinhua cited the ministry as saying.
Chinese investment abroad jumped 84.9% in July from a year earlier, the report said, compared with a decline of 5% year-on-year for the January-to-June period.
The figure put overseas direct investment at 4% year-on-year for the first seven months of 2014.
The government said there was no link between the dip in foreign investment, and recent measures against alleged retailers of imports.
"We are not only targeting foreign companies," Trade Ministry spokesperson Shen Danyang said.
The Chinese anti-competition watchdog is investigating alleged collusive price-fixing by retailers of high-end automobiles, including German-made BMW, Audi and Daimler, makers of Mercedes Benz.
House prices also fell in 64 of 70 surveyed cities, up from 55 cities in the previous month, Xinhua reported, citing the Natinal Bureau of Statistics.
These included a dip of 1.0% in Beijing in July compared with June, of 1.2% in Shanghai, and 1.3% in the southern city of Guangzhou.
The drop was the largest since some restrictions on real estate transactions were lifted in April 2011.