An efficient, finite elements (FE) based method of cross-sectional analysis of a longitudinally homogeneous beam, with an arbitrary cross section and material model assumed, submitted to tension/compression, bending, torsion, and shear is developed. A new formulation of this classical problem is done as a special case of the homogenization theory. It takes into account 3D strain and stress state, fulfilling equilibrium, compatibility, and constitutive equations at any point, stress-free conditions on lateral surfaces, but preserves control by cross-sectional stress resultant forces and corresponding generalized strains. A source of problems caused by the presence of a shear force is explained and a way of overcoming it is shown. In the paper both variational formulation of the problem and its 2D FE solution are given. Benchmark cases, including shear of: a square, a composite L-section, an orthotropic square, and an elasto-plastic analysis of shearing of a square section, show correctness of the method. Finally, two practical cases of application of the method to an analysis of reinforced concrete beam sections are shown. (C) 2015 Elsevier Ltd. All rights reserved.