The war in Afghanistan, which has caused about 2,400 US military deaths, is the longest one in American history.
Twitter accounts supporting US arch-enemy Iran regularly praise the attacks, but that was not the case Monday.
Approaches of both presdiential candidates differ and the outcome of the November 3 election will have long-term consequences not only for US troops, but for the wider region.
US President Donald Trump has been trying to make the case that he has fulfilled the promises he made four years ago as he campaigns for a second term.
Tensions between the arch-foes flared in Iraq where the United States deployed Patriot air defence missiles prompting neighbouring Iran to warn of consequences and demand a US withdrawal.
The move stopped the deployment or redeployment of some 90,000 US service members for the next two months.
The officials said over a dozen rockets landed inside the base, some struck the coalition quarters while others fell on a runway used by Iraqi forces.
The US will cut the number of forces in the country to 8,600, according to a statement by US Forces' Afghanistan spokesman Colonel Sonny Leggett.
President Donald Trump reiterated that he wants US troops to be pulled out of Syria, but indicated that a decision had not yet been taken.