Process for hydrotreating a heavy hydrocarbon fraction containing asphaltenes, sediments, sulphur-containing, nitrogen-containing and metallic impurities, in which the feed of hydrocarbons and hydrogen is passed, under conditions of hydrotreating, at a temperature between 320°C and 430°C, at a hydrogen partial pressure advantageously between 3 MPa and 30 MPa, at a space velocity advantageously between 0.05 and 5 volumes of feed per volume of catalyst and per hour, and with a ratio of hydrogen gas to liquid hydrocarbon feed advantageously between 200 and 5000 normal cubic metres per cubic metre, over a hydrotreating catalyst, in at least two fixed bed hydrotreating guard zones each containing at least two catalyst beds, the guard zones being arranged in series to be used cyclically, consisting of successive repetition of steps b), c) and c') defined below: - a step a) during which the feed passes through all the catalyst beds of the guard zones for a period at most equal to the deactivation time and/or clogging time of a guard zone, - a step a') during which the feed is introduced, by-passing the deactivated and/or clogged catalyst bed, onto the next catalyst bed not yet deactivated and/or clogged of the same guard zone for a period at most equal to the deactivation time and/or clogging time of a guard zone, - step a') being repeated until the feed is introduced onto the last catalyst bed not yet deactivated and/or clogged of the same guard zone for a period at most equal to the deactivation time and/or clogging time, - a step b) during which the deactivated and/or clogged guard zone is by-passed and the catalyst that it contains is regenerated and/or replaced with fresh catalyst and during which the other guard zone(s) are used, - a step c) during which the feed passes through all the catalyst beds of the guard zones, the guard zone of which the catalyst was regenerated during the preceding step being reconnected so as to be downstream of all the other guard zones and said step being continued for a period at most equal to the deactivation time and/or clogging time of a guard zone, - a step c') during which the feed is introduced onto the next catalyst bed not yet deactivated and/or clogged of the same guard zone for a period at most equal to the deactivation time and/or clogging time of a guard zone, step c') being repeated until the feed is introduced onto the last catalyst bed not yet deactivated and/or clogged of the same guard zone for a period at most equal to the deactivation time and/or clogging time of a guard zone. - a step a) during which the feed passes through all the catalyst beds of the guard zones for a period at most equal to the deactivation time and/or clogging time of a guard zone, - a step a') during which the feed is introduced, by-passing the deactivated and/or clogged catalyst bed, onto the next catalyst bed not yet deactivated and/or clogged of the same guard zone for a period at most equal to the deactivation time and/or clogging time of a guard zone, - step a') being repeated until the feed is introduced onto the last catalyst bed not yet deactivated and/or clogged of the same guard zone for a period at most equal to the deactivation time and/or clogging time, - a step b) during which the deactivated and/or clogged guard zone is by-passed and the catalyst that it contains is regenerated and/or replaced with fresh catalyst and during which the other guard zone(s) are used, - a step c) during which the feed passes through all the catalyst beds of the guard zones, the guard zone of which the catalyst was regenerated during the preceding step being reconnected so as to be downstream of all the other guard zones and said step being continued for a period at most equal to the deactivation time and/or clogging time of a guard zone, - a step c') during which the feed is introduced onto the next catalyst bed not yet deactivated and/or clogged of the same guard zone for a period at most equal to the deactivation time and/or clogging time of a guard zone, step c') being repeated until the feed is introduced onto the last catalyst bed not yet deactivated and/or clogged of the same guard zone for a period at most equal to the deactivation time and/or clogging time of a guard zone.