Considering $mathbb{Z}_n$ the ring of integers modulo $n$, the classical Fermat-Euler theorem establishes the existence of a specific natural number $varphi(n)$ satisfying the following property: $ x^{varphi(n)}=1%hspace{1.0cm}text{for all}hspace{0.2cm}xin mathbb{Z}_n^*, $ for all $x$ belonging to the group of units of $mathbb{Z}_n$. In this manuscript, this result is extended to a class of rings that satisfies some mild conditions.