Mobile agent systems have unique properties and characteristics and represent a new application development paradigm. Existing solutions to distributed computing problems, such as deadlock avoidance algorithms, are not suited to environments where both clients and servers move freely through the network. This paper describes a distributed deadlock solution for use in mobile agent systems. The properties of this solution are locality of reference, topology independence, fault tolerance, asynchronous operation and freedom of movement. The presented technique, called the shadow agent solution proposes dedicated agents for deadlock initiation, detection and resolution. These agents are fully adapted to the properties of a mobile agent environment.