The invention relates to a method and a controller for operating a motor vehicle designed as a fuel
cell vehicle. The motor vehicle has a high-
voltage system, an
electric machine, a high-
voltage energy store and a fuel
cell system, the method having the following steps: When the high-
voltage energy store is operated with an operating power which is greater in absolute terms than a continuous power and smaller in absolute terms than a maximum permissible peak power, a period of time is detected in which the high-voltage energy store is operated with the electrical power. When the detected period of time reaches a maximum permissible period of time, the maximum permissible peak power of the high-voltage energy store is reduced by a time gradient in absolute terms to the continuous power. When the difference between the maximum permissible peak power and the operating power reaches a threshold value, the electrical operating power of the fuel
cell system is increased in a traction mode and reduced in a coasting mode, wherein the electrical operating power of the high-voltage energy store is reduced in absolute terms to less than the continuous power in order to provide the electrical power requirement of the motor vehicle in total.