This paper deals with collision avoidance for road vehicles when operating at the limits of available friction. For collision avoidance, a typical control approach is to: (a) define a reference geometric path that avoids collision; (b) apply low-level control to perform path following. However, there are a number of limitations in this approach, which are addressed in the current paper. First, it is typically unknown whether a pre-defined reference path is feasible or over-conservative. Secondly, the control scheme is not well suited to avoiding a moving object, e.g. another vehicle. Further: incorrect choice of reference path may degrade performance, fast adaptation to friction change is not easy to implement and the associated low-level control allocation may be computationally intensive.In this paper we use the general nonlinear optimal control formulation, include some simplifying assumptions and base optimal control on the minimization of an underlying Hamiltonian function. A particle model is used to define an initial reference in the form of a desired global mass-center acceleration vector. Beyond that, yaw moment is taken into account for the purpose of enhancing the stability of the vehicle. The Hamiltonian function is adapted as a linear function of tyre forces and can be minimized locally for individual wheels; this significantly reduces computational workload compared to the conventional approach of forcemoment allocation. Several combinations of actuators are studied to show the general applicability of the control algorithm based on a linear Hamiltonian function. The method has the potential to be used in future vehicle control systems across a wide range of safety applications and hence improve overall vehicle agility and improve safety.