(CNN) After a long legal battle, a letter Tupac Shakur wrote to Madonna will now be auctioned.

The late rapper and the singer had dated prior to his death.

In a three-page handwritten note Shakur sent from prison in 1995, when he was 24 and she was then in her 30s, he wrote about their relationship and expressed regret to Madonna.

"I must apologize to you. Because like you said I haven't been the kind of friend I know I am capable of being. Not because I am evil or because you weren't worthy but at the risk of sounding over dramatic, the effects of racism make it difficult for a young black man to properly show affection for an older white woman," Tupac wrote.

Shakur died the following year.

Read More