A method of breaking a gas lock in an electrical submersible pump assembly, the method comprising the steps of: (a) detecting an occurrence of gas lock in a electrical submersible pump assembly, the electrical submersible pump assembly comprising an electrical submersible pump located in a well bore, a pump motor located in the well bore and attached to the electrical submersible pump, downhole sensors (24a - 24n) and a motor controller located at the surface of the well bore and electrically coupled to the pump motor through a three-phase power cable, by the substeps of: (i) monitoring an instantaneous value associated with the pump motor of the electrical submersible pump assembly, (ii) generating a threshold value based on historical data of values associated with the pump motor of the electrical submersible pump assembly, and (iii) comparing the instantaneous value to the threshold value to thereby detect the occurrence of gas lock in the electrical submersible pump assembly; and (b) breaking a detected occurrence of gas lock by the substeps of: (i) maintaining a pump operating speed for a first predetermined duration defining a waiting period to facilitate a separation of gas and liquid located above the pump, (ii) reducing the pump operating speed to a predetermined value defining a flush value for a second predetermined duration defining a flush period so that the fluid located above the pump falls back through the pump flushing out any trapped gas, and (iii) restoring the pump operating speed to the previously maintained pump operating speed. (a) detecting an occurrence of gas lock in a electrical submersible pump assembly, the electrical submersible pump assembly comprising an electrical submersible pump located in a well bore, a pump motor located in the well bore and attached to the electrical submersible pump, downhole sensors (24a - 24n) and a motor controller located at the surface of the well bore and electrically coupled to the pump motor through a three-phase power cable, by the substeps of: (i) monitoring an instantaneous value associated with the pump motor of the electrical submersible pump assembly, (ii) generating a threshold value based on historical data of values associated with the pump motor of the electrical submersible pump assembly, and (iii) comparing the instantaneous value to the threshold value to thereby detect the occurrence of gas lock in the electrical submersible pump assembly; and (i) monitoring an instantaneous value associated with the pump motor of the electrical submersible pump assembly, (ii) generating a threshold value based on historical data of values associated with the pump motor of the electrical submersible pump assembly, and (iii) comparing the instantaneous value to the threshold value to thereby detect the occurrence of gas lock in the electrical submersible pump assembly; and (b) breaking a detected occurrence of gas lock by the substeps of: (i) maintaining a pump operating speed for a first predetermined duration defining a waiting period to facilitate a separation of gas and liquid located above the pump, (ii) reducing the pump operating speed to a predetermined value defining a flush value for a second predetermined duration defining a flush period so that the fluid located above the pump falls back through the pump flushing out any trapped gas, and (iii) restoring the pump operating speed to the previously maintained pump operating speed. (i) maintaining a pump operating speed for a first predetermined duration defining a waiting period to facilitate a separation of gas and liquid located above the pump, (ii) reducing the pump operating speed to a predetermined value defining a flush value for a second predetermined duration defining a flush period so that the fluid located above the pump falls back through the pump flushing out any trapped gas, and (iii) restoring the pump operating speed to the previously maintained pump operating speed.