We investigate a class of the nonlinear Schrödinger equation in \( \mathbb {R}^N\) \(\begin{aligned} -\Delta u +V(x)u=|u|^{2^*-2}u+\lambda |u|^{p-2}u, \end{aligned}\) where \(N\ge 3\) , \(\lambda >0\) and \(p\in (2,2^*)\) with \( 2^*=\frac{2 N}{N-2}\) . Here, \(V(x)=V_1(x)\) for \(x_1>0\) and \(V(x)=V_2(x)\) for \(x_1<0\) , where \(V_1,V_2 \) are periodic in each coordinate direction. By providing a splitting Lemma corresponding to non-periodic external potential, we obtain the existence of ground state solution for the above problem. It is worth to mention that the arguments used in this paper are also valid for the Sobolev subcritical problem studied by Dohnal et al. (Commun Math Phys 308:511–542, 2011).