The authors study the issues on distributed geographical packet forwarding in wireless sensor and actuator networks (WSANs) using a stochastic optimal control approach. First, a distributed geographic-informed forwarding (DGIF) scheme is proposed that defines a set of distributed routing policies. Then, the distributed WSAN packet forwarding problem is modelled and analysed from the perspective of stochastic optimal control. The WSAN is viewed as a controlled stochastic system. The routing procedure is determined by the routing policy and system disturbance (e.g. the position uncertainty of remote nodes) jointly. An improved value iteration method is presented to accelerate the convergence of the optimal routing strategy. The reliability-driven routing algorithm (called DGIF-RRP) for emergency applications and the quality-of-service-aware routing algorithm (called DGIF-QRP) for real-time applications are proposed. Simulations are carried out to evaluate the proposed routing algorithms. The results show that DGIF-RRP and DGIF-QRP significantly outperform two enhanced versions of the Dijkstra's algorithm in emergency and real-time applications, respectively.