The energy level correlator K(s) and the form factor K̂(t) are calculated for a hypercubic billiard with small hyperspheres placed at random in its interior. Various regimes, characterized by the elastic mean free path l, resulting from the scattering on impurities, are identified. The analysis extends from the ballistic regime, where l is much larger than the size of the system, via intermediate regimes, to the diffusive regime, where l is much smaller than its size. Semiclassical expressions for the density of states of chaotic and integrable systems in terms of classical periodic orbits are used. The diagonal approximation for K̂(t) is made for short times, while non-perturbative methods are used for long times. The analysis makes use of analytic properties of classical dynamical zeta function associated with the Perron-Frobenius operator. The general features are relevant for mesoscopic systems.