Rapper Azealia Banks has apologised to Zayn Malik, five months after unleashing a racist tirade against him on Twitter.

In an open letter posted on her Instagram account Banks explained she had lashed out at Malik after mistaking a tweet he had posted to be a “personal attack” on her.

Azealia BanksAzealia Banks has apologised to Zayn Malik

"There are no words that can fully express how sorry I am. Recent events have taught me the importance of taking accountability for one's actions. I want and need to say I am sorry, I was wrong.” she began.

"I reached out, on Twitter, to congratulate you on leaving One Direction and finding your own path. Many artists sell their souls to this business and sacrifice their happiness for a career; walking away took bravery, strength, formidable principles and a powerful sense of self-worth. I applaud you for this.”

More: Azealia Banks Goes To Police After Russell Crowe Hotel Spat

“As a black woman, in America, I sometimes forget that there are words and comments that hurt other communities. At times, I am so consumed by my own struggle, and the struggle of my race, that I forget to consider the hardships other minorities continue to endure.”

Banks then apologised not only to Zayn, “but to all those I hurt and offended."

“I am not cruel, nor am I heartless or vindictive,” she continued. “There is a lot of love in my heart and there is good in my soul. What I did was wrong and I am committed to becoming a better person.”

More: Azealia Banks Accuses Russell Crowe Of Assault After Reported Hotel Altercation

Banks concluded by praising Zayn for how he handled the drama. "Throughout my transgressions you remained a gentleman and I applaud you for displaying class and maintaining a level head," she wrote.

“The world could learn a lot from you and I hope you can find room in your heart to accept my sincerest apologies."