In this paper, we introduce a class of rings generalizing unit regular rings and being a subclass of semipotent rings, which is called idempotent unit regular. We call a ring $R$ an idempotent unit regular ring if for all $r\in R-J(R)$, there exist a non-zero idempotent $e$ and a unit element $u$ in $R$ such that $er=eu$, where this condition is left and right symmetric. Thus, we have also that there exist a non-zero idempotent $e$ and a unit $u$ such that $ere=eue$ for all $r\in R-J(R)$. Various basic characterizations and properties of this class of rings are proved and it is given the relationships between this class of rings and some well-known classes of rings such as semiperfect, clean, exchange and semipotent. Moreover, we obtain some results about when the endomorphism ring of a module in a class of left $R$-modules $X$ is idempotent unit regular.