The ability to tune material properties using gating by electric fields is at the heart of modern electronic technology. It is also a driving force behind recent advances in two-dimensional systems, such as the observation of gate electric-field-induced superconductivity and metal-insulator transitions. Here, we describe an ionic field-effect transistor (termed an iFET), in which gate-controlled Li ion intercalation modulates the material properties of layered crystals of 1T-TaS2. The strong charge doping induced by the tunable ion intercalation alters the energetics of various charge-ordered states in 1T-TaS2 and produces a series of phase transitions in thin-flake samples with reduced dimensionality. We find that the charge-density wave states in 1T-TaS2 collapse in the two-dimensional limit at critical thicknesses. Meanwhile, at low temperatures, the ionic gating induces multiple phase transitions from Mott-insulator to metal in 1T-TaS2 thin flakes, with five orders of magnitude modulation in resistance, and superconductivity emerges in a textured charge-density wave state induced by ionic gating. Our method of gate-controlled intercalation opens up possibilities in searching for novel states of matter in the extreme charge-carrier-concentration limit.