The first American to visit Afghanistan decided he was going to take the wild land by force. That's just what Americans did back then, I suppose. The young man was born into a privileged life for the time, and lived a life of globetrotting adventure as a young man. When the love of his life decided to marry another man, Josiah Harlan decided to make his world a little more interesting.
But so were the Afghan rulers and warlords.
Having grown up learning Greek and Latin and reading medical books and journals for fun, Harlan decided to join the British East India Company's expedition to Burma as a surgeon, even though he had never attended medical school. But he didn't stay for all of the company's wars. He left the company in 1826 to live in an Indian border town called Ludhiana. That's where he met Shuja Shah Abdali Durrani, the deposed ruler of Afghanistan that would shape Josiah Harlan's future.
The two men hatched a plan to oust the leader who deposed the Shah, Dost Mohammed Khan using a coalition of Sikh, Hindu, and Muslim fighters, then foment a full-scale rebellion in Afghanistan. Once the Shah was back on the throne, he would make Harlan his vizier. Things did not go according to plan. Khan defeated Shah at Kandahar and was forced to flee once more.
Dost Mohammed Khan can sleep soundly knowing the British got what was coming to them.
Harlan next fell in with Maharajah Ranjeet Singh, a great warrior king who had conquered most of what is today Northwest India and Pakistan. Singh, it turns out, knew how to party unlike anyone since the good ol' days of insane Roman emperors. He was also a hypochondriac, one that "Doctor" Josiah Harlan could treat. Harlan did treat the Maharajah, earning his trust and the governorship of Nurpur, Jasota, and later, Gujerat. But he eventually fell out of Singh's favor and turned to Dost Mohammed Khan – the man he tried to usurp in the first place.
Acting as a special military advisor to Khan, Harlan took to the battlefield against armies allied to the Maharajah, having taught the Afghans the "Western way of war," which basically meant using numerical superiority to your supreme advantage. With Khan, he was made royalty and led armies against the Sikhs in India, against Uzbek slavers, and even led punitive expeditions in the Hindu Kush. But upon returning from those raids, he found Khan was deposed, and the British occupied Kabul and had replaced Khan with ol' Shuja Shah.
The Maharajah's life was so great it gave him Forest Whitaker Eye before that was even a thing.
Even though Harlan was the Commander-In-Chief among all Afghans by Khan's decree, Khan was out and Shah was in. All the tribes and their warlords were now allied with Shah – that was just the Afghan way. Khan already fled, so it was time for Harlan to return to America and to his life in Pennsylvania.
Unsurprisingly, Pennsylvania had a marked lack of exotic spices, royal orgies, and international intrigue, so Harlan found himself trying to drum up American support to challenge Russia and Britain for supremacy in Afghanistan. America, however, had enough problems back home around the time the man returned in 1841, and there was little interest in it. Josiah Harlan moved to San Francisco where he spent the rest of his days practicing medicine.