A higher-order immersed boundary method is presented for solving the compressible Navier-Stokes equations applying viscous wall boundary conditions for the immersed geometry. The irregular finite difference stencil in the vicinity of the immersed boundary is stabilized by locally applying a constraint for the stencil coeffcients. This idea is borrowed from the method initially developed by Brehm and Fasel1 for the advection step in the projection method used to solve the incompressible Navier-Stokes equations. The extension of this method involves an optimization procedure of the immersed boundary stencil considering the linearized fully coupled system of equations. immersed scheme confirm that a stable immersed boundary treatment is achieved. The method of manufactured solutions is used to study the error convergence properties of the immersed boundary scheme. Validation cases demonstrate the accuracy of the scheme for steady/unsteady 2D/3D test cases. Finally, the method is used to simulate subsonic ows past a cylinder and sphere, a hypersonic Mach 6 boundary layer ow over a porous wall and subsonic boundary layer ow over a three-dimensional roughness element.