The secret is out. Taylor Swift co-wrote ex-boyfriend Calvin Harris’ current Top 5 hit with Rihanna “This Is What You Came For” under a pseudonym while they were still a couple.

After published reports that the song’s listed co-writer Nils Sjoberg was actually a Swift pseudonym, Harris confirmed her involvement on Twitter.

advertisement | advertise on newsday

“She sings on a little bit of it too,” Harris tweeted, adding, “Amazing lyric writer and she smashed it as usual. I wrote the music, produced the song, arranged it and cut the vocals, though. And initially she wanted it kept secret, hence the pseudonym.”

Harris also took Team Swift to task for leaking her involvement in the song, tweeting that it was “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.”

“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. “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 . . . Please focus on the positive aspects of YOUR life because you’ve earned a great one.(Meanwhile, Perry, who has had a strained relationship with Swift, cryptically tweeted Wednesday, “Time, the ultimate the truth teller.”)

No response from Swift. However, some speculate that the song caused the breakup, saying Swift was hurt when Ryan Seacrest asked Harris about collaborating with his then-girlfriend and he replied, “I can’t see it happening.”

advertisement | advertise on newsday

The couple split about a month later. Shortly after, Swift was seen publicly with actor Tom Hiddleston, who she met at the Met Gala in May.