Modi will be in China from May 14-16, the ministry said in a brief statement.
China and India have growing commercial links and deep historical ties, but their recent history has been overshadowed by suspicion and the two have yet to sort out a festering border dispute.
Underscoring the lack of trust, Modi’s official account on Weibo, China’s version of Twitter, which was set up on Monday, attracted many comments from Chinese users about a disputed part of Tibet belonging to China.
The nationalist Indian prime minister has been keen to resolve the territorial spat, which has clouded a rapidly expanding business relationship.
However, there is no simple solution to a conflict that largely dates back to British colonial decisions about Tibet.
The disagreement over the 3,500-km (2,175-mile) border in the Himalayas led to a brief war in 1962 and involves large swathes of remote territory.
China claims more than 90,000 sq km (35,000 sq miles) disputed by New Delhi in the eastern sector of the Himalayas. Much of that forms the Indian state of Arunachal Pradesh, which China calls South Tibet.
India says China occupies 38,000 square km (14,600 sq miles) of its territory on the Aksai Chin plateau in the west.
In September, the two armies faced off in the Ladakh sector in the western Himalayas just as Chinese President Xi Jinping was visiting India for the first summit talks with Modi. (Reuters)