Predicting the grasping function during reach-to-grasp motions is essential for controlling a prosthetic hand or a robotic assistive device. An early accurate prediction increases the usability and the comfort of a prosthetic device. This work proposes an electromyographic-based learning approach that decodes the grasping intention at an early stage of reach-to-grasp motion, i.e. before the final grasp/hand pre-shape takes place. Superficial electrodes and a Cyberglove were used to record the arm muscle activity and the finger joints during reach-to-grasp motions. Our results showed a 90% accuracy for the detection of the final grasp about 0.5 s after motion onset.This paper also examines the effect of different objects' distances and different motion speeds on the detection time and accuracy of the classifier. The use of our learning approach to control a 16-degrees of freedom robotic hand confirmed the usability of our approach for the real-time control of robotic devices. (C) 2017 Elsevier B.V. All rights reserved.