NEW YORK - Taylor Swift has confirmed that she co-wrote ex-boyfriend Calvin Harris' latest hit song under an alias, prompting the DJ-producer to send a series of angry tweets.

A representative for Swift said Wednesday that she used the name Nils Sjoberg for “This is What You Came For,” Harris' song featuring Rihanna. Harris responded on Twitter and said Swift had wanted to keep the collaboration secret.

“(It's) 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 though,” Harris tweeted.

Harris and Swift announced last month that they'd broken up.

The Scottish DJ also targeted Swift's reported new relationship with actor Tom Hiddleston: “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.”

Harris tweeted that Swift is looking for “someone new to try and bury like Katy,” referring to Katy Perry. Swift's popular song “Bad Blood” was rumoured to be about her failed friendship with Perry.

“I'm not that guy, sorry. I won't allow it,” Harris tweeted. “Please focus on the positive aspects of YOUR life because you've earned a great one.”