The present invention relates to a method of enrolling a fingerprint of a user's finger, by means of an electronic device comprising a touch sensor having an active area corresponding to a first surface portion of the electronic device; and a fingerprint sensor having an active area corresponding to a second surface portion of the electronic device. The comprises the steps of acquiring a touch sensor signal indicative of a sub-area of the touch sensor being touched by the finger; acquiring a partial fingerprint image of a portion of the fingerprint; a positional relationship between the portion of the fingerprint and the finger based on the sub-area and a positional relationship between the first and second surface portions of the electronic device; and forming a fingerprint template based on acquired partial fingerprint images and the determined positional relationships.