  Let $c$ be a square-free positive integer and $p$ a prime satisfying $p\nmid
c$. Let $h(-c)$ denote the class number of the imaginary quadratic field
$\mathbb{Q}(\sqrt{-c})$. In this paper, we consider the Diophantine equation
$$cx^2+p^{2m}=4y^n,~~x,y\geq 1, m\geq 0, n\geq 3, \gcd(x,y)=1,
\gcd(n,2h(-c))=1,$$ and we describe all its integer solutions. Our main tool
here is the prominent result of Bilu, Hanrot and Voutier on existence of
primitive divisors in Lehmer sequences.
