Harmonic distortion caused by increasing size of inverter-based distributed generation (DG) can give rise to power quality problems in distribution power networks. Therefore, it is very important to determine allowable DG penetration level by considering the harmonic related problems. In this study, an optimization methodology is proposed for maximizing the penetration level of DG while minimizing harmonic distortions considering different load profiles. The methodology is based on updating the voltage magnitude and angle at point of common coupling depending on the size of DG to be utilized in the harmonic power flow modeling. The harmonic parameters are determined by using decoupled harmonic power flow method, in which the harmonic source modeling with harmonic current spectrum angle adjustment is embedded, while the nonlinear loads and inverter-based DGs are connected to the distribution power network. The allowable penetration level of DGs is determined based on power quality constraints including total harmonic voltage distortion, individual harmonic voltage distortion, and RMS bus voltage limits in the optimization framework. Fuzzy-c means clustering method is also applied to decrease the computational effort of the optimization process in the long-term load profile. The effectiveness of the proposed method is illustrated on the IEEE 33-bus radial distribution network for different scenarios. (C) 2016 Elsevier Ltd. All rights reserved.