Newly elected transgender lawmaker Danica Roem accompanied pop star Demi Lovato to Sunday's American Music Awards (AMA) in Los Angeles to send a message about bullying.

“I’m really grateful that Demi has spent her career advocating for people who need a voice when they feel voiceless, and that she really understands that no matter what you look like, where you come from, how you worship or who you love, you should be welcomed and celebrated because of who you are not despite of,” Roem, who is set to become the first openly transgender person elected and seated in a state legislature, told E! News.

Lovato, who says she's "completely inspired" by Roem's story, attended the AMAs to sing a song directed to people who bullied her in school and on social media.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

While performing her new single, “Sorry Not Sorry,” at the awards show, messages like "I hate you" and "You're ugly" — which Lovato has received on Twitter — were projected on the screen behind her. Last year, the singer briefly stopped using Twitter and Instagram because of the cyber-bullying she faced.

I'll always stand for inclusion & against bullying. Demi Lovato's performance tonight made it clear that's where she stands too. Thank you for the once-in-a-lifetime opportunity @ddlovato.

PWC folks: I'll be back bright & early Monday to talk education policy. See you soon! #NoH8 https://t.co/6BJzz5xhNp — Danica Roem (@pwcdanica) November 20, 2017

Roem, a 33-year-old former journalist, has had her own experiences with bullying on the campaign trail.

Her opponent in the race to represent Virginia's 13th District, longtime Republican State Delegate Bob Marshall, repeatedly referred to Roem, a transgender woman, using male pronouns and refused to participate in a debate with her. In an interview with a conservative program on American Family Radio, Marshall also said Roem's gender identity “goes against the laws of nature and nature’s God.”

.@ddlovato and Danica Roem both look STUNNING tonight. I can tell this performance is going to INSPIRE! #DEMIxAMAs pic.twitter.com/qI4ug6mwlD — AMAs (@AMAs) November 20, 2017

Lovato said she connected with Roem because she learned of how Roem overcame these struggles and made history.

"We connected because I heard her story,” Lovato told E! News on the red carpet. “My story with 'Sorry Not Sorry' is about bullying, and I wanted to have her in the audience with me tonight, because I feel like we have been through some of the same things, and now we get to share this experience together."

In an interview on the red carpet, Roem, who is scheduled to be inaugurated on Jan. 10, said that while she's more of a heavy-metal fan, she appreciates Lovato's advocacy for inclusion.