Supergirl is to become the first live-action TV series to feature a transgender superhero.
Activist and actor Nicole Maines, who is transgender herself, will play the role of Nia Nal, who becomes known as Dreamer.
"It seems only fitting that we have a trans superhero for trans kids to look up to," she said after the announcement at Comic Con in San Diego, California.
Nia Nal will be introduced in Supergirl's upcoming fourth season.
The character has been described as "a soulful young transgender woman with a fierce drive to protect others".
Speaking to Variety, Nicole Maines said: "I want fans to take away an understanding of trans people. We can be anybody, we can be who we want, we can be superheroes - because in many ways we are."
Shown in the UK on Sky One, Supergirl is based on the DC Comics character of the same name and is set in the same universe as other comic book characters such as The Flash and Arrow.
Melissa Benoist stars as the title character, who is Superman's cousin and one of the last surviving residents of Krypton.
The new character, Nia Nal, will be introduced as an employee of CatCo Worldwide Media, the organisation where much of the series is set.
Nicole Maines says she wants viewers to realise that a trans character's plotline doesn't have to revolve around them being trans.
"Nia is so much more than just a trans superhero. She is a reporter, she is hopeful, she's powerful, wise and such a good friend."
In 2014, Nicole Maines and her family went to court after her school prevented her from using the girls' toilet.
As a result, Maine's Supreme Judicial Court ruled the school had violated the state's human rights act.
Nicole has gone on to an acting career, winning a 2016 GLAAD award for her performance in US show Royal Pains.