This paper presents a unified space vector modulation (SVM) algorithm for lifetime prolongation of thermally-overheated power semiconductor devices in multilevel inverters. Thermal overheating is the main cause of shortened-lifetime and open-circuit faults of the devices. Power semiconductor devices are subjected to thermal overheating due to their ageing that results from continuous overloading and power cycling. Moreover, thermal overheating in high power devices may result from its degradation and faults in the cooling system. When a thermal overheating is detected in one of the power devices, the proposed algorithm is applied to relieve the overheated device and dangerous circumstances are avoided as a result. The proposed algorithm relies on using the redundancy property between switching states in multilevel inverters to continuously evaluate a cost function of the junction temperature of thermally-overheated device for all possible switching sequences set, then it identifies the optimal relieving switching sequence. The proposed unified SVM is general that can be applied to any multilevel inverter, and also is valid for switching devices, as well as DC-link capacitors. The proposed algorithm has been designed and validated by simulation and experimental prototypes of three-level T-type inverter.