This paper proposes a methodology for modeling and controlling a flexible material handling system (MHS), composed of multiple automated guided vehicles (AGVs), suitable for Flexible Manufacturing Systems (FMSs). The AGVs incorporate artificial intelligent techniques to: i) facilitate the configuration and adaptation when there are layout modifications and ii) simplify the interaction between them using simple coordination models. In order to achieve higher flexibility, the MHS makes use of a decentralized navigation control, which increases autonomy and scalability, and a distributed Petri net for solving task allocation and traffic control problems. In order to facilitate the integration with the manufacturing processes, tasks dispatched by manufacturing cells are allocated by the MHS itself, taking into account pending transportation tasks and the system's performance. The whole system has been tested in a real factory and is currently in operational use.