Several forms of a theorem providing general expressions for the force and torque acting on a rigid body of arbitrary shape moving in an inhomogeneous incompressible flow at arbitrary Reynolds number are derived. Inhomogeneity arises because of the presence of a wall that partially or entirely bounds the fluid domain and/or a non-uniform carrying flow. This theorem, which stems directly from Navier–Stokes equations and parallels the well-known Lorentz reciprocal theorem extensively employed in low-Reynolds-number hydrodynamics, makes use of auxiliary solenoidal irrotational velocity fields and extends results previously derived by Quartapelle & Napolitano (AIAA J., vol. 21, 1983, pp. 911–913) and Howe (Q. J. Mech. Appl. Maths, vol. 48, 1995, pp. 401–426) in the case of an unbounded flow domain and a fluid at rest at infinity. As the orientation of the auxiliary velocity may be chosen arbitrarily, any component of the force and torque can be evaluated, irrespective of its orientation with respect to the relative velocity between the body and fluid. Three main forms of the theorem are successively derived. The first of these, given in (2.19), is suitable for a body moving in a fluid at rest in the presence of a wall. The most general form (3.6) extends it to the general situation of a body moving in an arbitrary non-uniform flow. Specific attention is then paid to the case of an underlying time-dependent linear flow. Specialized forms of the theorem are provided in this situation for simplified body shapes and flow conditions, in (3.14) and (3.15), making explicit the various couplings between the body’s translation and rotation and the strain rate and vorticity of the carrying flow. The physical meaning of the various contributions to the force and torque and the way in which the present predictions reduce to those provided by available approaches, especially in the inviscid limit, are discussed. Some applications to high-Reynolds-number bubble dynamics, which provide several apparently new predictions, are also presented.