The paper presents a new mathematical and numerical model for analysis of two-layered spatial beams with inter-layer slip taken into account. Each of the two layers can be made of different material, such as timber, concrete or steel. These layers, connected together, form a composite beam, for example concrete–steel, concrete–timber or timber–timber composite beam. There are several novelties in the presented mathematical and numerical model. The first novelty is that the model enables the analysis of the influence of shear deformations on the stiffness of two-layered spatial beams. The second novelty of the model is that the inter-layer slip can only happen in longitudinal and transverse direction, while inter-layer slip in perpendicular direction is not possible. Yet another important novelty of the model is a consistent separation of the basic equations of the model into two unrelated groups and introduction of appropriate constraining equations. The negative influence of poorly conditioned equations due to the constraint equations, which would otherwise occur during the solving of the equations of the model, is thus avoided. The equations of the presented numerical model are solved by applying the finite elements method. Thus, a new family of deformation based finite elements has been developed, where all the deformation quantities of the beam model are interpolated with Lagrange polynomials of arbitrary degree. By introducing a new deformation based finite element we are able to avoid all types of locking that is typical for displacement-based finite elements. Convergence and parametric studies, presented in the paper, show: (i) that the deformation-based finite elements are very accurate and therefore suitable for the analysis of two-layer spatial beams, (ii) that the inter-layer slip in both considered directions significantly affects the values of physical quantities and therefore has to be considered in the analysis and (iii) that shear deformations have smaller effect on the stiffness of two-layer spatial beams than they have on the stiffness of homogeneous spatial beams.