In this paper, an efficient computational method for numerical solution of infinite horizon optimal control problems is presented. In the proposed method, transformed Legendre spectral scheme is utilized to transcribe the problem to a mathematical programming problem which can be solved by the well-developed optimization algorithms. The main advantages of the present method are obtaining good results and high rate of convergence, while the infinite horizon problem is solved on the original time interval of the problem without transforming it to a finite one. Numerical results of three examples are presented and efficiency of the method is reported.