An inverter device comprising: an inverter that drives and controls an electric motor by converting DC to AC by turning switching elements on/off; a temperature detection section that detects a switching elements temperature (Tj), arranged in a vicinity of said switching elements of said inverter; a gate generating section that performs on/off control of said switching elements of said inverter such that a torque of said electric motor becomes a torque instruction value (Tqa, Tqb); and a torque limit section that applies limit to said torque instruction value (Tqa, Tqb) of said electric motor such that said switching elements temperature (Tj) obtained from said temperature detection section is restricted to no more than an element upper limiting temperature, said torque limit section characterized by: torque restriction means that finds a torque restriction value proportional to a deviation of said switching elements temperature (Tj) and a preset torque restriction commencement temperature that is lower than said element upper limiting temperature; torque restriction mitigation means that finds a torque restriction mitigation value for mitigating said torque restriction value equal to an integrated value of a deviation of said element upper limiting temperature and said switching elements temperature (Tj) and limited by an upper-limit limiter such that said torque restriction mitigation value does not exceed said torque restriction value; a first subtractor that finds a torque limit value by subtracting a torque restriction mitigation value found by said torque restriction mitigation means from said torque restriction value found by said torque restriction means; and a second subtractor that finds a limited torque instruction value obtained by subtracting said torque limit value found by said first subtractor from said torque instruction value (Tqa, Tqb) and outputs to said gate generating section. an inverter that drives and controls an electric motor by converting DC to AC by turning switching elements on/off; a temperature detection section that detects a switching elements temperature (Tj), arranged in a vicinity of said switching elements of said inverter; a gate generating section that performs on/off control of said switching elements of said inverter such that a torque of said electric motor becomes a torque instruction value (Tqa, Tqb); and a torque limit section that applies limit to said torque instruction value (Tqa, Tqb) of said electric motor such that said switching elements temperature (Tj) obtained from said temperature detection section is restricted to no more than an element upper limiting temperature, said torque limit section characterized by: torque restriction means that finds a torque restriction value proportional to a deviation of said switching elements temperature (Tj) and a preset torque restriction commencement temperature that is lower than said element upper limiting temperature; torque restriction mitigation means that finds a torque restriction mitigation value for mitigating said torque restriction value equal to an integrated value of a deviation of said element upper limiting temperature and said switching elements temperature (Tj) and limited by an upper-limit limiter such that said torque restriction mitigation value does not exceed said torque restriction value; a first subtractor that finds a torque limit value by subtracting a torque restriction mitigation value found by said torque restriction mitigation means from said torque restriction value found by said torque restriction means; and a second subtractor that finds a limited torque instruction value obtained by subtracting said torque limit value found by said first subtractor from said torque instruction value (Tqa, Tqb) and outputs to said gate generating section. torque restriction means that finds a torque restriction value proportional to a deviation of said switching elements temperature (Tj) and a preset torque restriction commencement temperature that is lower than said element upper limiting temperature; torque restriction mitigation means that finds a torque restriction mitigation value for mitigating said torque restriction value equal to an integrated value of a deviation of said element upper limiting temperature and said switching elements temperature (Tj) and limited by an upper-limit limiter such that said torque restriction mitigation value does not exceed said torque restriction value; a first subtractor that finds a torque limit value by subtracting a torque restriction mitigation value found by said torque restriction mitigation means from said torque restriction value found by said torque restriction means; and a second subtractor that finds a limited torque instruction value obtained by subtracting said torque limit value found by said first subtractor from said torque instruction value (Tqa, Tqb) and outputs to said gate generating section.