After the Mongol Empire collapsed, Afghanistan’s land was mostly split between the Mughal Empire of India and the Safavid Empire of Iran. Now that most Asian trade went by sea instead of over the Silk Road, Afghanistan was less important than it had been before.
In the early 1700s, though, both the Safavid and the Mughal Empires got weaker. The people of Afghanistan started to try to set up their own independent country. The Iranian Nader Shah defeated their first attempt in the 1730s, so Afghanistan became part of the country of Iran for a while. After Nader Shah died in 1749, Afghanistan worked towards independence again. By 1760 Afghanistan was independent under Ahmad Shah Durrani.
By 1751, Ahmad Shah Durrani held not only all of modern Afghanistan, but also Mashad in modern Iran. And he had taken most of what is now Pakistan (the Indus river valley) from the collapsing Mughal Empire too. Taking the Indus Valley gave Afghanistan a route to the ocean, so they could trade with other countries more easily. Ahmad Shah Durrani then tried to conquer northern India – more of the old Mughal Empire – but the Maratha Empire‘s army turned him back.
But after Ahmad Shah Durrani died in 1772, his sons and grandsons didn’t keep the empire together, and Afghanistan’s neighbors began to conquer their land back again. In the early 1800s, the Iranian Fath-Ali tried, but he failed. Then the Sikh empire took over most of Pakistan. In 1837, the Afghanis attacked the Sikh empire, trying to get Pakistan back, but the Sikhs fought them off with the help of the British army. About this time, Afghanistan began to be the border in a big fight between Russia and Britain for control of Asia known as the Great Game.