Boundary control to damp the undesirable vibrations in a Timoshenko beam is considered. For this purpose, controllability and wellposedness of the system are examined. Performance index is defined with regards to the dynamic response of the beam that is defined as a weighted quadratic functional of the displacement and the velocity at terminal time and expenditure of the control energy added as a penalty term. In order to obtain the optimal control function, an adjoint variable satisfying the adjoint equation corresponding to state equation is introduced. The maximum principle is formulated and optimal control function is obtained. Also, by using maximum principle, control problem is transformed into solving a system of partial differential equations including state and adjoint variables with initial, boundary and terminal conditions. MATLAB is used to obtain the solution of the system. Numerical results are given in tables and graphical forms.