Exclusive

Demi Lovato was clearly frustrated that her ex-fiance was going ham about their breakup, because she blindsided her team by dropping her new breakup song on Twitter, sending them into a frenzy to get it on platforms so her fans can buy the tune ... sources with direct knowledge tell TMZ.

We're told Demi wrote her new single, "Still Have Me," a while ago with friends. Our sources say she kept the hook but changed the lyrics to reflect her split with Max Ehrich.

Sources connected to Demi tell us she became so frustrated with Max's recent antics -- the most recent, somehow comparing Demi and the breakup to Jeffrey Epstein -- that she didn't want to wait to release the song. We're told, her team is scrambling to get the single on streaming services like Apple Music and Spotify so that fans can purchase it and streaming numbers can be collected.

The song's lyrics certainly paint a picture of heartbreak, "I'm a mess and I'm still broken ... I don't have much but at least I still have me ... and that's all I need."

Demi also sings, "All the highs and now just lows. But it doesn't even matter, cause I'd rather be alone. All my life disappeared and I'm laying right here while the silence is piercing ... and it hurts to breathe."

As we reported ... Max has said he learned about their breakup when he read about it in the tabloids while filming on set. Demi, of course, reportedly disputes Max's account ... her people say she and Max spoke, she told him it was over and about to come out in the media. Max also took aim at Demi's manager, Scooter Braun, claiming he was trying to silence him.