Charge density waves (CDWs) are periodic modulations of the density of conduction electrons in solids. They are collective states that arise from intrinsic instabilities often present in low-dimensional electronic systems. The most well-studied examples are the layered dichalcogenides-an example of which is TiSe2, one of the first CDW-bearing materials to be discovered. At low temperatures, a widely held belief is that the CDW competes with another collective electronic state, superconductivity. But despite much exploration, a detailed study of this competition is lacking. Here we report how, on controlled intercalation of TiSe2 with Cu to yield CuxTiSe2, the CDW transition can be continuously suppressed, and a new superconducting state emerges near x=0.04, with a maximum transition temperature T-c of 4.15 K at x=0.08. CuxTiSe2 thus provides the first opportunity to study the CDW to superconductivity transition in detail through an easily controllable chemical parameter, and will provide fundamental insight into the behaviour of correlated electron systems.