Web service composition (WSC) is the task of combining a chain of connected single services together to create a more complex and value-added composite service. Quality of Service (QoS) has been mostly applied to represent nonfunctional properties of Web services and differentiate those with the same functionality. Many research has been done on QoS-aware WSC. However, existing methods are restricted to predefined workflows, which can incur a couple of limitations, including the lack of guarantee for the optimality on QoS and for the completeness of finding a composite service. In this paper, instead of predefining a workflow for service composition, we propose a novel planning-based approach that can automatically convert a QoS-aware composition task to a planning problem with temporal and numerical features. Furthermore, we use state-of-the-art planners, including an existing one and a self-developed one, to handle complex temporal planning problems with logical reasoning and numerical optimization. Our approach can find a composite service graph with the optimal overall QoS. We implement a prototype system and conduct extensive experiments on large Web service repositories. The experimental results show that our proposed approach largely outperforms existing ones in terms of solution quality and is efficient enough for practical deployment.