Medium-temperature baking, denoting an in-vacuum heat treatment of superconducting rf cavities in the range, has recently revealed significant beneficial effects on cavity performance by increasing its intrinsic quality factor. The baking process reduces the thickness of the niobium oxide surface layer and diffuses oxygen into the bulk material. Generally, heat treatment is performed in a vacuum furnace, which, however, has some disadvantages, including risk of contamination in the furnace and subsequent handling or later regrowth of the oxide layer. To eliminate these issues, ideally the heat treatment should be carried out within the module (“in situ”) with the cavity assembled in the cold string and thereby avoiding the need for an external vacuum furnace treatment. First, proof-of-principle experiments have demonstrated the feasibility of in situ treatment but required the installation of heat tape and temperature controllers. In this paper, we explore an alternative approach by heating the cavity with rf power in a cavity mode, thereby predominantly using the existing rf infrastructure and no need for extra ancillaries. Nevertheless, several challenges need to be addressed, including the need for sufficient rf coupling, providing homogeneous power deposition (especially in multicell cavities), and the drift of both the resonance frequency and the mode’s field pattern with temperature. The results from the rf heating experiments on a TESLA 9-cell cavity at HZB’s HoBiCaT facility are presented in this paper, including simultaneous bead-pull measurements to monitor the field profile of the different modes. In addition, a numerical model was developed to calculate the heat deposition profile. Benchmarking the model with the experimental results allowed for the successful determination of its free parameters. This model can help to predict the rf heating effects under various conditions to guide the implementation of an effective rf heating “recipe.” The model was used to demonstrate the feasibility of a heating scheme alternating between two modes to reach a sufficiently high and homogeneous temperature profile as required for mid-T baking.