In robotic tasks where the manipulator has to make transition from free space motion to constrained one, there always exists a inevitable impact phase (contact transition phase). Examples can be the autonomous exploratory motion of the end-effector in a cluttered environment, or grasping and manipulation of objects using dexterous mechanical end-effector. A number of controllers have been proposed in the literature with various discussions on their practical implications. In this paper a simple and efficient controller is proposed for the robotic contact tasks. The controller is based on the notion of switching control law where the structure of the controller remains unchanged during the phase transition and only the magnitudes of its gains are changed. The proposed control law maintans the stable performance during the impact phase of the manipulator when making contact with general environment. In addition, the controller exhibits stable and robust performance during the post-contact phase with the desired contact force regulation. The stability of the proposed controller is shown using the Lyapunov method which guarantees the exponential rate of convergence of the state during the contact transition to post-contact phase. Experimental results are presented to demonstrate the practicality of the proposed controller.