The rings considered in this article are commutative with identity $1\neq 0$. By a proper ideal of a ring $R$, we mean an ideal $I$ of $R$ such that $I\neq R$. We say that a proper ideal $I$ of a ring $R$ is a maximal non-prime ideal if $I$ is not a prime ideal of $R$ but any proper ideal $A$ of $R$ with $ I\subseteq A$ and $I\neq A$ is a prime ideal. That is, among all the proper ideals of $R$, $I$ is maximal with respect to the property of being not a prime ideal. The concept of maximal non-maximal ideal and maximal non-primary ideal of a ring can be similarly defined. The aim of this article is to characterize ideals $I$ of a ring $R$ such that $I$ is a maximal non-prime (respectively, a maximal non maximal, a maximal non-primary) ideal of $R$.