The 32-year-old Scottish DJ ranted about the 26-year-old American singer in a series of tweets Wednesday after her rep confirmed Swift wrote Harris and Rihanna's song "This is What You Came For."
"Hurtful to me at this point that her and her team would go so far out of their way to try and make me look bad at this stage," Harris tweeted. "I figure if you're happy in your new relationship you should focus on that instead of trying to tear your ex bf down for something to do."
"I know you're off tour and you need someone new to try and bury like Katy [Perry] etc but I'm not that guy, sorry. I won't allow it," he added. "Please focus on the positive aspects of your life because you've earned a great one."
Swift's rep had revealed the singer wrote "This is What You Came For" under the pseudonym Nils Sjoberg after TMZ reported Swift's rumored involvement early Wednesday. Harris acknowledged Swift's contribution at the beginning of his rant.
"She sings on a little bit of it too. Amazing lyric writer and she smashed it as usual," he lauded. "I wrote the music, produced the song, arranged it and cut the vocals though. And initially she wanted it kept secret, hence the pseudonym."
Swift wrote the song for Harris while they were dating but the pair ultimately decided to keep the collaboration a secret. Harris instead released the track with Rihanna in late April, just weeks before his split from Swift.
Sources told TMZ "the breaking point" in the relationship came when Harris publicly dismissed the idea of working with Swift the day the "This is What You Came For" was released. Swift has since started dating actor Tom Hiddleston.