The polysulfide shuttle effect and the growth of Li dendrites are detrimental to the practical use of lithium-sulfur (Li-S) batteries. Here, we show that these challenges can be eliminated with hexamethylphosphoramide (HMPA) as a co-solvent. HMPA shows strong coordination interaction with Li+ and thus preferentially remains in the inner sheath of the Li+ solvation structure. The solvation structure not only minimizes the solubility of poly-sulfides but also generates a LiF-rich solid-electrolyte interphase, which are responsible to the suppression of polysulfide shuttle effect and the elimination of Li dendrites, respectively. As a result, HMPA-based electrolytes enable Li//Li symmetric cells to exhibit long cycling lifetimes of up to 600 h at 5 mA cm-2 along with significantly reduced polarization. Moreover, Li-S cells containing the HMPA-based electrolyte also display marked enhancement in cycling stability (e.g., 619.6 mAh g-1 after 300 cycles at 0.2 C). These results are superior to those measured for control cells that contain a conventional electrolyte. The concepts and method described herein may be extended to benefit other types of energy storage devices that use active metals as anodes.