Nicole Maines, the plaintiff who helped set a precedent for allowing trans individuals to use the restroom of their choice, will join The CW drama as a series regular and play the groundbreaking character of Nia Nal (aka Dreamer).

The CW's Supergirl is making some important TV history.

The DC Comics drama has enlisted transgender activist and actress Nicole Maines to play TV's first transgender superhero.

Maines will join the fourth season of the Warner Bros. TV-produced drama as Nia Nal (aka Dreamer), a character described as a soulful young transgender woman with a fierce drive to protect others. Nia's journey in season four means fulfilling her destiny as the superhero Dreamer, which is similar to Kara's (Melissa Benoist) journey to become Supergirl.

If Maines' name sounds familiar, it should. The activist made headlines across the globe in June 2013 when a Maine Supreme Court ruled that her rights had been violated under the state's Human Rights Act and set a landmark victory for trans rights in its ruling that transgender people can use the bathroom of their choice. Maines was previously featured on the HBO documentary The Trans List. She is the subject of the book Becoming Nicole by Amy Ellis Nutt. Her acting credits include USA Network's Royal Pains.

The character of Nia Nal is a spin on the DC Comics character of Nura Nal (aka Dream Girl), who can foresee the deaths of others but is not specifically identified as transgender.

The role arrives as transgender stories are becoming increasingly common on the small screen. FX's dance musical Pose, already renewed for a second season, set a TV record earlier this year for the largest cast of transgender characters portrayed by transgender series regulars.

Maines' casting comes as inclusive storytelling has become increasingly the norm on broadcast, cable and streaming series. For his part, Supergirl executive producer Greg Berlanti — who has a TV-record 15 scripted series — has made it a personal mission to tell LGBTQ stories. "Even with the action shows though, I've still tried to do my part in making those shows relevant where I can, whether it's having openly gay actors play straight characters or straight actors play gay characters," he told The Hollywood Reporter in May 2016.

That Supergirl plans to introduce a transgender superhero arrives days after The CW and Warner Bros. announced plans to team with Berlanti to develop a Batwoman TV series. As in the comics, the character of Batwoman will be a lesbian. That makes it the first time that a lesbian superhero will be the center of a TV show.

Maines' casting — as well as fellow new series regulars April Parker Jones (as Col. Haley) and David Ajala (as Manchester Black) — was announced Saturday at San Diego Comic-Con as part of DC/The CW's superhero block. Maines is repped by Defining Artists Agency and Landis-Simon.

Supergirl returns Oct. 14 at 8 p.m. ET/PT as part of The CW's first-ever Sunday night lineup.