The use of flying platforms such as unmanned aerial vehicles (UAVs), popularly known as drones, is rapidly growing. In particular, with their inherent attributes such as mobility, flexibility, and adaptive altitude, UAVs admit several key potential applications in wireless systems. On the one hand, UAVs can be used as aerial base stations to enhance coverage, capacity, reliability, and energy efficiency of wireless networks. On the other hand, UAVs can operate as flying mobile terminals within a cellular network. Such cellular-connected UAVs can enable several applications ranging from real-time video streaming to item delivery. In this paper, a comprehensive tutorial on the potential benefits and applications of UAVs in wireless communications is presented. Moreover, the important challenges and the fundamental tradeoffs in UAV-enabled wireless networks are thoroughly investigated. In particular, the key UAV challenges such as three-dimensional deployment, performance analysis, channel modeling, and energy efficiency are explored along with representative results. Then, open problems and potential research directions pertaining to UAV communications are introduced. Finally, various analytical frameworks and mathematical tools such as optimization theory, machine learning, stochastic geometry, transport theory, and game theory are described. The use of such tools for addressing unique UAV problems is also presented. In a nutshell, this tutorial provides key guidelines on how to analyze, optimize, and design UAV-based wireless communication systems. arXiv:1803.00680v2 [cs.IT] 17 Mar 2019 particular, the work in [45] discussed the applications of flying ad-hoc networks, design considerations, communication protocols, and privacy aspects. In [46], a comprehensive review of UAV-based flying ad hoc networks (FANETs) and their challenges are provided. Moreover, several FANET design challenges in terms of mobility, node density, topology change, radio propagation model, and power consumption are investigated. The survey in [47] discussed the design challenges pertaining to the use of UAVs as relay nodes in flying adhoc networks. The work in [48] provided a comprehensive survey on the potential use of UAVs for supporting IoT services. In particular, key challenges and requirements for designing UAV-assisted IoT networks are discussed in [48]. In [49], the authors surveyed different mechanisms and protocols for developing airborne communication networks while considering low-altitude-platform communications, high-altitudeplatform communications, and integrated airborne communication systems. The survey in [50] studied the use of HAPs for broadband communications. Moreover, it described key advantages of HAPs compared to terrestrial and satellite networks, suitable HAP airships, frequency bands, and possible HAP-based network architectures. The authors in [51] studied the challenges and advantages associated with a multi-tier drone network architecture. Moreover, this work investigated the performance of a multi-tier drone...