The unmanned aerial vehicle (UAV)-assisted transmission in ultra-reliable low-latency communication (URLLC) can achieve precise control in environments where communication infrastructures are unavailable, with enormous benefits in military and commercial applications. This paper investigates a three-hop decode-and- forward UAV-assisted system to guarantee the stringent quality-and-service requirements in long-distance URLLC. First, the block error rate (BLER) is derived for air-to-ground and air-to-air channels. Then, the transmit power, blocklength, and UAV deployment in three-dimensional space are optimized together to jointly minimize the overall BLER and UAV communication energy consumption. The formulated non-convex problem is divided into subproblems and an iterative algorithm is proposed to tackle it by utilizing the block coordinate descent. Different search techniques and the block successive convex approximation approach are used to conquer the subproblems. Finally, simulations are conducted to demonstrate the system performance and the effectiveness of the proposed algorithm.