To provide wireless access in regions without infrastructure coverage, we study a UAV-enabled mobile relaying system in which an intelligent UAV is employed to help in information transmission from a ground base station (GBS) to remote ground users by flying along a circular path. Furthermore, free-space optics (FSO) is used as a backhauling solution to greatly boost the capacity of the GBS-UAV backhaul link. The optical beam transmitted from the GBS to the UAV carries both data and energy, allowing for simultaneous communications and charging at the UAV. Our aim is to simultaneously optimize the UAV’s energy efficiency (EE) and spectral efficiency (SE) by optimizing the UAV’s trajectory (circular radius), height and flying speed. The resulting optimization is complex and non-convex, making it difficult to solve. Motivated by the deep reinforcement learning’s (DRL) huge success in different areas, we develop an innovative DRL-based approach to the joint optimization problem. The simulations show that the developed FSO-based UAV relaying model effectively boosts wireless connectivity in edge and infrastructure-lacking areas, considering both EE and SE needs.