In this paper, a compact third-order gas-kinetic scheme is proposed for the compressible Euler and Navier-Stokes equations. The main reason for the feasibility to develop such a high-order scheme with compact stencil, which involves only neighboring cells, is due to the use of a high-order gas evolution model. Besides the evaluation of the time-dependent flux function across a cell interface, the high-order gas evolution model also provides an accurate time-dependent solution of the flow variables at a cell interface. Therefore, the current scheme not only updates the cell averaged conservative flow variables inside each control volume, but also tracks the flow variables at the cell interface at the next time level. As a result, with both cell averaged and cell interface values the high-order reconstruction in the current scheme can be done compactly. Different from using a weak formulation for highorder accuracy in the Discontinuous Galerkin (DG) method, the current scheme is based on the strong solution, where the flow evolution starting from a piecewise discontinuous high-order initial data is precisely followed. The cell interface time-dependent flow variables can be used for the initial data reconstruction at the beginning of next time step. Even with compact stencil, the current scheme has third-order accuracy in the smooth flow regions, and has favorable shock capturing property in the discontinuous regions. We believe that the current scheme is one of the most robust and accurate third-order compact schemes for both smooth and discontinuous viscous and heat conducting flow simulations. It can be faithfully used from the incompressible limit to the hypersonic flow computations. Many test cases are used to validate the current scheme. In comparison with many other high-order schemes, the current method avoids the use of Gaussian points for the flux evaluation along the cell interface and the multi-stage Runge-Kutta time stepping technique. Even with the increasing of computational cost in the evaluation of a multidimensional time-dependent gas distribution function at a cell interface, the current scheme is still efficient. Also, due to its multidimensional property of including both derivatives of flow variables in the normal and tangential directions of a cell interface, the viscous flow solution, especially those with vortex structure, can be accurately captured. With the same stencil of a second order scheme, numerical tests clearly demonstrate that the current compact third-order scheme is as robust as well-developed second-order shock capturing schemes, but provides much more accurate numerical solutions than the second order counterparts. 1