Emperor Wu dispatched Zhang Qian in 138 BCE (not 139 BCE) to forge an alliance with the Yuezhi against their common enemy, the Xiongnu.