When you lend money to a friend, you can either have your money back or the friendship. Let this be a lesson that you never lend money in an amount that can put you in trouble.
As of now, if you are willing to lose your friendship, ask him to borrow from somebody else and pay you. Promise him that you will give it back to him once your emergency is gone but donβt give this time.