We study the Casimir effect in axion electrodynamics. A finite θ-term affects the energy dispersion relation of photon if θ is time and/or space dependent. We focus on a special case with linearly inhomogeneous θ along the z-axis. Then we demonstrate that the Casimir force between two parallel plates perpendicular to the z-axis can be either attractive or repulsive, dependent on the gradient of θ. We call this repulsive component in the Casimir force induced by inhomogeneous θ the anomalous Casimir effect.