"It was a decision that hurt and still hurts deep in my soul but I understand that it is the right time," Messi, 39, wrote on Instagram.