Recognition of power quality (PQ) troubles is a critical task in the electrical power system. All previous works solve this problem using two‐step methodology: Feature extraction and classification steps with each step using its own techniques, and this consumes a computation time. The purpose of this study is to utilise a novel artificial intelligence (AI) technique for recognition of PQ events. The proposed AI technique is the long short‐term memory (LSTM) network, which detects and classifies the PQ events in one step. This technique extracts amplitude, disturbance duration and total harmonic distortion from the captured waveform, and the LSTM uses its own rules to classify the PQ events. Many simple PQ events such as interruption, sag, flicker, swell and surge or complex PQ events such as sag plus harmonics and swell plus harmonics are generated using MATLAB programming environment to evaluate the performance of LSTM. Also, real‐time measurements are collected from an industrial substation and are used to ensure the effectiveness of the proposed LSTM technique. A comparison with other techniques is conducted and the results verify the good performance of LSTM in classifying the PQ problems.