A convex optimal control problem with inequality constraints involving a class of linear hyperbolic partial differential equations is considered. A result on the existence of optimal control is proved and a necessary condition for optimality is given. An iterative algorithm is presented for solving the optimal control problem under consideration. The convergence properties are also studied.