The "I'm sorry" phrase is still powerful but also tell them that you don't want to lose them as friends.
Write a poetic letter, email or text. Be emotional. Mention their name, send it, then wait for a nice reply.
Cling to them until they forgive you, then give them space. Never just leave when you're told to do so by your upset friend. Stay around.
Friendship is not a life and death issue. If they can't no longer accept you, get away and forget everything. Meet with new good friends and start a new life, learning from the experience.