We study a filament eruption, two-ribbon flare, and coronal mass ejection (CME) that occurred in active region NOAA 10898 on 6 July 2006. The filament was located south of a strong sunspot that dominated the region. In the evolution leading up to the eruption, and for some time after it, a counter-clockwise rotation of the sunspot of about 30 degrees was observed. We suggest that the rotation triggered the eruption by progressively expanding the magnetic field overlying the filament and test this scenario with three-dimensional zero-beta MHD simulations. To this end, we study the effect of twisting the potential field overlying a pre-existing flux rope by imposing appropriate vortex flows at the bottom boundary of the simulation box. We first consider a relatively simple and symmetric system, and then study a more complex and asymmetric magnetic configuration, whose photospheric flux distribution and coronal structure is guided by the observations and a potential field extrapolation. In both cases, we find that the twisting leads to the expansion of the overlying field. As a consequence of the progressively reduced magnetic tension, the flux rope quasi-statically adapts to the changed environmental field, rising slowly. Once the tension is sufficiently reduced, a distinct second phase of evolution occurs where the flux rope enters an unstable regime characterized by a strong acceleration.