We present a nonlinear post-Friedmann framework for structure formation, generalizing to cosmology the weak-field (post-Minkowskian) approximation, unifying the treatment of small and large scales. We consider a universe filled with a pressureless fluid and a cosmological constant Λ, the theory of gravity is Einstein's general relativity and the background is the standard flat Λ CDM cosmological model. We expand the metric and the energy-momentum tensor in powers of 1/c, keeping the matter density and peculiar velocity as exact fundamental variables. We assume the Poisson gauge, including scalar and tensor modes up to 1/c4 order and vector modes up to 1/c5 terms. Through a redefinition of the scalar potentials as a resummation of the metric contributions at different orders, we obtain a complete set of nonlinear equations, providing a unified framework to study structure formation from small to superhorizon scales, from the nonlinear Newtonian to the linear relativistic regime. We explicitly show the validity of our scheme in the two limits: at leading order we recover the fully nonlinear equations of Newtonian cosmology; when linearized, our equations become those for scalar and vector modes of first-order relativistic perturbation theory in the Poisson gauge. Tensor modes are nondynamical at the 1/c4 order we consider: they are purely nonlinear and describe a distortion of the spatial slices determined at this order by a constraint, quadratic in the scalar and vector variables. The main results of our analysis are as follows: (a) at leading order a purely Newtonian nonlinear energy current sources a frame-dragging gravitomagnetic vector potential, and (b) in the leading-order Newtonian regime and in the linear relativistic regime the two scalar metric potentials are the same, while the nonlinearity of general relativity makes them different.