Lasting for about half century, Tubo control started to dissolve following the assassination of its last leader in 842. Between 848 and 851, a local strongman named Zhang Yichao routed the Tubo army in both places.
"Upon his military victory in Dunhuang, Zhang Yichao immediately dispatched a delegation — in fact, several delegations — to inform the Tang emperor that Dunhuang (known then as Shazhou) was once again part of the empire. They were on the road for three years. And that was the beginning of Dunhuang under the Zhang family rule," says Rong Xinjiang, a celebrated Silk Road scholar and a mentor to Wen during his time as a student of history at Peking University.
That rule ended with Zhang Chengfeng's fiasco and his subsequent replacement by Cao Yijin who, upon coming to power, immediately restored Dunhuang to its previous status as a component of, if not the Tang, then another northern-China based power entity.
"By announcing its inclusion in a bigger empire, which its neighbors had been part of, or had forged close bonds with in their own ways, Dunhuang effectively signed itself up for stability and a share of the Silk Road," says Rong.