High-energy rechargeable lithium metal batteries have attracted soaring attention because of high specific capacity and low electrochemical potential of lithium metal. Unfortunately, the lithium dendrite growth upon Li plating severely hinders its practical application. Herein, we report the preparation of ionic liquid (IL) immobilized polymer gel electrolytes with strong ion-dipole interactions between imidazolium-based IL and fluorinated copolymer gel for stable and dendrite-free Li+ plating/stripping. The adoption of IL leads to the formation of a tightly cross-linked gel framework with tethered anions, providing greatly-improved mechanical strength, good heat resistance, favorable self-healing capability, high ionic conductivity, and a stable electrochemical window up to 4.5 V vs. Li+/Li that can satisfy the demand of high-voltage cathodes. The membrane of IL-immobilized polymer gel electrolyte enabled dendrite-free Li deposition, showing stable cycling durability for 1000 h at 0.5 mA cm−2, and the functional mechanism was carefully investigated. By coupling with this gel electrolyte membrane, the LiFePO4/Li cell exhibit much superior cycling stability and rate performance. Moreover, the lithium-sulfur batteries assembled with the IL-immobilized polymer gel electrolyte also show efficient suppression of polysulfide shuttling and self-discharge, bringing high specific capacity and long cycling life.