A method of controlling a first and a second reverse-conducting insulated gate bipolar transistor, RC-IGBT, (S 1; S 2) electrically connected in series, wherein: a collector (C 1) of the first RC-IGBT (S 1) is electrically connected to a positive pole of a direct current, DC, voltage source and an emitter (E 2) of the second RC-IGBT (S 2) is electrically connected to a negative pole of the DC voltage source; and an emitter (E 1) of the first RC-IGBT (S 1) is electrically connected to a collector (C 2) of the second RC-IGBT (S 2) to form an alternating current, AC, terminal for providing an output current; the method comprising receiving a direction and a magnitude of the output current, comparing the magnitude of the output current with a selected threshold, which is not zero, and applying a gate voltage (b 1 -g 1;b 2 -g 2) to respective gates (G 1; G 2) of the first and second RC-IGBTs, wherein said gate voltage is controlled based on the direction of the output current, the comparison of the magnitude of the output current with the selected threshold and on a command signal (Cmd) indicating targeted turn-on and turn-off instants for the respective RC-IGBTs, and wherein, if said comparison indicates that the magnitude of the output current exceeds the selected threshold, in which case the direction of the output current indicates which one of the RC-IGBTs is operated in IGBT mode and which other RC-IGBT is operated in diode mode, then respectively applying high-level and low-level gate voltage pulses to the RC-IGBT operated in IGBT mode during respective targeted turn-on and turn-off instants as indicated by the command signal (Cmd) and omitting some switching for the other RC-IGBT operated in diode mode. a collector (C 1) of the first RC-IGBT (S 1) is electrically connected to a positive pole of a direct current, DC, voltage source and an emitter (E 2) of the second RC-IGBT (S 2) is electrically connected to a negative pole of the DC voltage source; and an emitter (E 1) of the first RC-IGBT (S 1) is electrically connected to a collector (C 2) of the second RC-IGBT (S 2) to form an alternating current, AC, terminal for providing an output current; the method comprising receiving a direction and a magnitude of the output current, comparing the magnitude of the output current with a selected threshold, which is not zero, and applying a gate voltage (b 1 -g 1;b 2 -g 2) to respective gates (G 1; G 2) of the first and second RC-IGBTs, wherein said gate voltage is controlled based on the direction of the output current, the comparison of the magnitude of the output current with the selected threshold and on a command signal (Cmd) indicating targeted turn-on and turn-off instants for the respective RC-IGBTs, and wherein, if said comparison indicates that the magnitude of the output current exceeds the selected threshold, in which case the direction of the output current indicates which one of the RC-IGBTs is operated in IGBT mode and which other RC-IGBT is operated in diode mode, then respectively applying high-level and low-level gate voltage pulses to the RC-IGBT operated in IGBT mode during respective targeted turn-on and turn-off instants as indicated by the command signal (Cmd) and omitting some switching for the other RC-IGBT operated in diode mode.