Even with the military strained by long-term deployments in Iraq and Afghanistan , the Pentagon has been steadily expanding its presence outside of declared war zones , dispatching troops to embassies in remote parts of Africa , Asia and the Middle East to conduct counterterrorism missions and to train local militaries .