The US military's search for a detailed and trustworthy source of information on the hearts and minds of the rural communities of Afghanistan and Pakistan has led them to an unlikely author.

Greg Mortenson is not a politician or special forces guru but a mountaineer turned humanitarian worker whose book Three Cups of Tea has become required reading for the US high command.

The book explains how a failed ascent of K2 led Mortenson to a small village in north-eastern Pakistan.

To show his gratitude to the villagers who looked after him when he came down from the mountain, the American promised to build them a school.

For three years, he lived and worked in the Karakoram mountain villages of northern Pakistan, learning about the Balti people and their culture. It led to him setting up dozens of schools – mainly for girls – in remote parts of Pakistan and Afghanistan.

The book takes its title from a Balti proverb: "The first time you share tea with a Balti, you are a stranger. The second time you take tea, you are an honoured guest. The third time you share a cup of tea, you become family."

In 1996, Mortenson co-founded the Central Asia Institute (CAI) with Silicon Valley pioneer Jean Hoerni.

CAI, a non-profit organisation, has so far been involved in the establishment or support of 131 schools, which educate more than 58,000 children — 44,000 of them girls.

Three Cups of Tea, subtitled "One Man's Mission to Promote Peace … One School at a Time", was published in 2006 and has sold more than 4m copies around the world.

After proving a hit with the wives of several senior US military men, Mortenson's book eventually found perhaps its most influential reader: General Stanley McChrystal.

Hours before he flew to Washington to tender his resignation to President Barack Obama following a disastrously outspoken profile in Rolling Stone magazine, McChrystal emailed Mortenson.

"Will move through this and if I'm not involved in the years ahead, will take tremendous comfort in knowing people like you are helping Afghans build a future," the outgoing commander said.

McChrystal's email provided further proof of the profound influence Mortenson's work has had on US military thinking in the region.

According to the New York Times, Mortenson has spoken at dozens of military bases and had lunch with General David Petraeus, the architect of the US's Iraq surge and the man chosen to replace McChrystal.

He has also brokered and participated in many meetings between tribal leaders and the US military in the region, where his local knowledge has proved invaluable.

However, Mortenson concedes that forging links with remote communities and helping to educate their children will not alter the situation overnight.

He expects his quest for peace, "one school at a time", to take a generation.

"But al-Qaida and the Taliban are looking at it long-range over generations," he told the NYT.

"And we're looking at it in terms of annual fiscal cycles and presidential elections."