In this paper a quasi-sliding mode control for a permanent magnet synchronous motor (PMSM) is proposed where a cascade control scheme based on a properly designed state observer provides accurate speed tracking performance. The ultimate boundedness of both the observation error and the speed tracking error is proven. The controller performance has been validated using hardware in the loop (HIL) tests on a simulator based on the model of a commercial PMSM drive. Tests show that the proposed observer-based controller produces good speed trajectory tracking performance and it is robust in the presence of disturbances affecting the system