If the relevant context in which the person you intend to refer to is uniquely singled out by the description "friend of mine", you use the definite "my friend", otherwise you use "a friend of mine". (At least, that's my best understanding of how a definite would be distinguished from an indefinite.)
Here, you invoke a past conversation in which a friend of yours asks you to come. How many friends were parties to this conversation? If there were something in the context suggesting you were talking with many friends, you should choose the indefinite form, but if the conversation was just one-on-one, you should use the definite form.
The situation in which the past conversation involved just a single friend comes readily to mind, so the definite "my friend" works.
We can test whether the above is correct by modifying the example to make more likely a scenario in which there are several people who might be picked out by the description -- then, the indefinite form should be preferred. Since a teacher might have several students, try: "My student asked me to come" (as compared with "A student of mine asked me to come").
Well, that still sounds pretty good, but sometimes you might have just a single student that you're talking with, so let's narrow it down: "My student asked me in class to come." Now, this should sound peculiar, because in a class you're teaching, there would be several other people around in the conversational context who count as "student of mine".
In my opinion, the last does sound peculiar. I should have said "A student of mine asked me in class to come."