Today, unmanned aerial vehicles (UAVs), also known as drones, have become extremely popular in military applications, commercial applications, and academic research. Flying ad hoc network (FANET) is a new type of ad hoc network in which small drones are grouped as an ad hoc model. These networks have unique characteristics, including moving in a 3D space, high mobility, frequent topological changes, limited resources, low density of nodes, and so on, which impose various challenges when designing a proper and efficient routing scheme. In this paper, we present a fuzzy logic-based routing scheme for flying ad hoc networks. The proposed routing scheme has two phases: route discovery phase and route maintenance phase. In the first phase, we propose a technique for calculating the score of each node in the network to prevent the broadcast storm problem and control flooding the control messages, which have been broadcast to discover a new route in the network. This score is calculated based on various parameters such as movement direction, residual energy of nodes, link quality and node stability. Moreover, in the route selection process, we design a fuzzy system to select routes with more fitness, less delay, and fewer hops for data transfer. The second phase includes two steps: preventing route failure in order to detect and modify paths at the failure threshold, and reconstructing failed routes in order to recognize and quickly replace these routes. Finally, the proposed routing scheme is implemented in NS2 to evaluate its performance and determine its efficiency. The simulation results are compared with three routing methods, namely ECaD, LEPR, and AODV. These results show that the proposed routing method outperforms other routing schemes in terms of end to end delay, packet delivery rate, route stability, and energy consumption. However, it has slightly increased the routing overhead.INDEX TERMS Flying ad hoc network (FANET), Routing, Fuzzy logic, Unmanned aerial vehicle (UAV), Artificial intelligence (AI)