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 fingeracquiring a partial fingerprint image of a portion of the fingerprinta 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 deviceand forming a fingerprint template based on acquired partial fingerprint images and the determined positional relationships.