The military exercise will take place under the framework of Shanghai Cooperation Organisation, a China-dominated security grouping which is increasingly seen as a counterweight to NATO, officials said.
They said the main aim of the exercise, Peace Mission, will be to enhance counter-terror cooperation among the eight SCO member countries.
It will be for the first time since Independence that India and Pakistan will both be part of a military exercise, though the armies of the two nations have worked together in UN peace keeping missions, they said.
India's membership was strongly pushed by Russia while Pakistan's entry into the grouping was backed by China. With expansion of the grouping, SCO now represents over 40 per cent of humanity and nearly 20 per cent of the global GDP.
India feels that as an SCO member, it will be able to play a major role in addressing the threat of terrorism in the region. It is also keen on deepening its security-related cooperation with the SCO and its Regional Anti-Terrorism Structure (RATS) which specifically deals with issues relating to security and defence.
India has been holding military exercise with China. The two countries are likely to resume their bilateral military exercise in September. Last year the drill was suspended following a tense standoff between their troops in Doklam.