An ablation apparatus, comprising: a catheter, having a distal portion for insertion into a body cavity of a living subject and configured to bring the distal portion into contact with a tissue in the body cavity; a power generator for generating energy at a power output level; an ablation electrode disposed on the distal portion, adapted to accept the energy from the power generator via the catheter and to conduct the energy to the tissue for ablation thereof; a magnetic resonance imaging system comprising field magnets and a reconstruction processor, the reconstruction processor comprising a peak calculation module and a temperature analyser, wherein the magnet resonance imaging system is configured to determine a temperature of the tissue; and a processor configured to iteratively: determine a measured temperature of the tissue and a measured power level of the energy conducted through the ablation electrode; and control the power output level to minimise the deviation between the measured power level and a target power level, and the deviation between the measured temperature and a target temperature, by incrementing or decrementing a current level over time, wherein for each iteration, the current level is incremented or decremented responsively to a function of both the deviation between the measured power level and the target power level and the deviation between the measured temperature and the target temperature. a catheter, having a distal portion for insertion into a body cavity of a living subject and configured to bring the distal portion into contact with a tissue in the body cavity; a power generator for generating energy at a power output level; an ablation electrode disposed on the distal portion, adapted to accept the energy from the power generator via the catheter and to conduct the energy to the tissue for ablation thereof; a magnetic resonance imaging system comprising field magnets and a reconstruction processor, the reconstruction processor comprising a peak calculation module and a temperature analyser, wherein the magnet resonance imaging system is configured to determine a temperature of the tissue; and a processor configured to iteratively: determine a measured temperature of the tissue and a measured power level of the energy conducted through the ablation electrode; and control the power output level to minimise the deviation between the measured power level and a target power level, and the deviation between the measured temperature and a target temperature, by incrementing or decrementing a current level over time, wherein for each iteration, the current level is incremented or decremented responsively to a function of both the deviation between the measured power level and the target power level and the deviation between the measured temperature and the target temperature. determine a measured temperature of the tissue and a measured power level of the energy conducted through the ablation electrode; and control the power output level to minimise the deviation between the measured power level and a target power level, and the deviation between the measured temperature and a target temperature, by incrementing or decrementing a current level over time, wherein for each iteration, the current level is incremented or decremented responsively to a function of both the deviation between the measured power level and the target power level and the deviation between the measured temperature and the target temperature.