They said the main aim of the exercise, Peace Mission, will be to enhance counter-terror cooperation among the eight SCO member countries.
The officials said India's participation at the exercise was confirmed by Defence Minister Nirmala Sitharaman during a meeting of SCO Defence Ministers' meeting in Beijing last week.
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.
The SCO was founded at a summit in Shanghai in 2001 by the Presidents of Russia, China, Kyrgyz Republic, Kazakhstan, Tajikistan and Uzbekistan.
India and Pakistan were admitted as observers of the grouping in 2005. Both the countries were admitted as full members of the bloc last year.
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.