The compact design of a fuzzy distance relay, which includes its impact on using a unified power flow controller in a power system, has been adopted as the object of the study. Traditional power system grids have increasingly widely used flexible alternating current transmission system devices in recent years to increase power system stability when faults, unbalance, and sudden changes in load occur. This plays a role in improving power quality, power factor corrections, and power flow control. A unified power flow controller is one of these devices that is most used, popular and meets these benefits, but it simultaneously gives a different change in the apparent impedance of the protection system due to its design. To overcome these issues, the proposed novel design of a fuzzy distance relay is made with the assistance of MATLAB® Simulink and Neuro-Fuzzy Designer. The proposed design work was divided into three parts, the first without fault and the second one including four scenarios without using and using a unified power flow controller in different transmission line locations. The design was carried out in the third part after collecting all input-output data sets. This paper offers an efficient design method, which depends on the input value of the observed apparent impedance, also known as resistance (R), and reactance (X). The output is a trip signal to the circuit breaker when a fault occurs. The advantages of the proposed design are a fast-clearing time of 1.42 ms, and working when utilizing a unified power flow controller in different locations; the results show a fast clearing although the long impedance trajectory for some cases. The fast fault clearing will make the system more stable and overcome the maloperation of the distance relay