The meeting was headed by Fang Fenghui, a member of the military commission, which is the military head of China's armed forces. Representatives of the four countries convened in Urumqi, the capital of the western Xinjiang region.
According to the report of Xinhua news agency, the four countries recognized that there is a growing threat of extremism and that it is an obstacle to regional stability.
To counteract terrorism, the four countries agreed that they will implement a "four-country mechanism" for intelligence sharing and training.
The officials who attended the meeting were Afghan army chief of general staff, General Qadam Shah Shaheem; Pakistani army chief General Raheel Sharif; and the Chief of General Staff of the Tajikistan armed forces, Major General E. A. Cobidrzoda.
Fenghui thanked Shaheem for the support that the Afghan military provided to suppress forces of the East Turkestan Islamic Movement (ETIM). The rebels want a separate state in Xinjiang.
The Chinese government denied that it was sparking tension in Xinjiang. Rebels blame the government for spurring tension in the area.
The EITM is a separatist organization founded by Uyghur militants in western China. They have reported having initiated 200 acts of terrorism from 1990 to 2001.
Both the U.N. and the U.S. have declared the EITM as a terrorist group.
Pakistan and China have both approached the U.S. to facilitate peace talks with the Taliban to resolve a 15-year conflict. The talks broke down when Taliban leader Mullah Akhtar Mansour was killed in May by American troops.
In July, Chinese officials expressed concern and interest in the Afghan peace talks and assistance were necessary.
"As a friendly and close neighbor of Afghanistan, China sincerely hopes that the Afghan people can live in peace, stability, and security, and benefit from the country's development," said Hua Chunying, the ministry spokesperson.