Whereas power-electronics-based power systems are expected to enable more integration of renewable energy sources, they could pose crucial challenges including stability issues due to the Thévenin impedance seen by inverters. Such problems could be mitigated by enabling the inverters to estimate the grid impedance by including a grid impedance estimation technique into their control loop. However, one aspect which has been overlooked thus far is that the accuracy of such grid impedance estimation techniques is significantly affected by various grid conditions. For instance, the unbalance in three-phase power systems causes unwanted oscillations at double the fundamental frequency in the inverters control loops. Therefore, this paper proposes a simple and reliable online estimation of the grid impedance under unbalanced conditions. The technique is based on wide-band impedance estimation incorporated into the control loop of the positive sequence of a three-phase grid-connected inverter equipped with a positive-and negative-sequence control (PNSC) strategy. Additionally, complex curve fitting is utilized to obtain parametric models of the grid impedance. To demonstrate the efficacy of the proposed grid impedance estimation technique, extensive case studies are performed. These include: (1) unbalanced operations of both resistive-inductive (RL) and resistive-inductive-capacitive (RLC) models of the grid, (2) background harmonics, and (3) asymmetrical impedances of the network.