(CNN) The pep rally was underway as a South Carolina high school student headed to the bathroom. A teacher trailed him. The student is transgender, and she wanted to make sure he used "the right one," he said.

To him, the right one is the boys' bathroom, which he says he has used since seventh grade without incident. Then, in his senior year, school administrators told him he had to use the girls' restroom, he said. They also gave him the option to use the nurse's restroom.

When he exited the bathroom, the teacher did not say anything to him, but he knew from the "exasperated" look on her face that he was in trouble.

The next morning, he was called into the vice principal's office and told he was suspended for one day for using the boys' bathroom.

Jazz Jennings became famous at age 6 when Barbara Walters interviewed her for a "20/20" segment about transgender children. Now 14, she hosts a popular series of videos on YouTube and is starring this summer in a TLC reality show about her life.

Jazz Jennings became famous at age 6 when Barbara Walters interviewed her for a "20/20" segment about transgender children. Now 14, she hosts a popular series of videos on YouTube and is starring this summer in a TLC reality show about her life.

Joshua Alcorn voiced a desire to live as a girl, but the Ohio teenager's parents said they wouldn't stand for that. In December 2014, Alcorn, 17, was fatally struck by a tractor-trailer on an interstate after leaving a suicide note that said in part, "To put it simply, I feel like a girl trapped in a boy's body." It was signed "Leelah." The case drew national attention to the plight of misunderstood transgender youth.

Joshua Alcorn voiced a desire to live as a girl, but the Ohio teenager's parents said they wouldn't stand for that. In December 2014, Alcorn, 17, was fatally struck by a tractor-trailer on an interstate after leaving a suicide note that said in part, "To put it simply, I feel like a girl trapped in a boy's body." It was signed "Leelah." The case drew national attention to the plight of misunderstood transgender youth.

After years as an androgynous male model, Australian Andrej Pejic underwent sex-reassignment surgery in 2014 and is now Andreja Pejic.

After years as an androgynous male model, Australian Andrej Pejic underwent sex-reassignment surgery in 2014 and is now Andreja Pejic.

On January 20, 2015, President Barack Obama became the first sitting U.S. president to mention the word "transgender" in a State of the Union address. Transgender activists hailed his speech.

On January 20, 2015, President Barack Obama became the first sitting U.S. president to mention the word "transgender" in a State of the Union address. Transgender activists hailed his speech.

Transgender activist and author Janet Mock attends the eighth annual Clinton Global Citizen Awards in New York in September 2014. Her 2014 memoir, "Redefining Realness," was a best-seller.

Transgender activist and author Janet Mock attends the eighth annual Clinton Global Citizen Awards in New York in September 2014. Her 2014 memoir, "Redefining Realness," was a best-seller.

Actor Jeffrey Tambor portrays a divorced father who begins transitioning to a woman in the Amazon series "Transparent," which debuted in February 2014. For his performance, Tambor won a Golden Globe for best actor in a TV musical or comedy series.

Actor Jeffrey Tambor portrays a divorced father who begins transitioning to a woman in the Amazon series "Transparent," which debuted in February 2014. For his performance, Tambor won a Golden Globe for best actor in a TV musical or comedy series.

Transgender model and reality TV personality Carmen Carrera attends a fashion show in September 2013 in New York. That year, thousands of fans signed a petition requesting that she be a model during the 2013 Victoria's Secret Fashion Show, but the campaign was unsuccessful.

Transgender model and reality TV personality Carmen Carrera attends a fashion show in September 2013 in New York. That year, thousands of fans signed a petition requesting that she be a model during the 2013 Victoria's Secret Fashion Show, but the campaign was unsuccessful.

"Orange Is the New Black" actress Laverne Cox attends an August 2014 event for Emmy nominees. Cox became the first openly transgender person to appear on the cover of Time magazine.

"Orange Is the New Black" actress Laverne Cox attends an August 2014 event for Emmy nominees. Cox became the first openly transgender person to appear on the cover of Time magazine.

Filmmaker Lana Wachowski attends a tribute to the late film critic Roger Ebert in October 2013 in Chicago. Born Larry Wachowski, he made the "Matrix" trilogy with brother Andy Wachowski before transitioning to living as a woman. Wachowski is the first major Hollywood director to come out as transgender.

Filmmaker Lana Wachowski attends a tribute to the late film critic Roger Ebert in October 2013 in Chicago. Born Larry Wachowski, he made the "Matrix" trilogy with brother Andy Wachowski before transitioning to living as a woman. Wachowski is the first major Hollywood director to come out as transgender.

Chaz Bono, the only child of entertainers Cher and Sonny Bono, arrives at a "Dancing With the Stars" special in May 2013. Bono was named Chastity at birth but came out as a lesbian in 1995 and later transitioned to living as a man. His transformation was chronicled in a book and a documentary feature, "Becoming Chaz."

Chaz Bono, the only child of entertainers Cher and Sonny Bono, arrives at a "Dancing With the Stars" special in May 2013. Bono was named Chastity at birth but came out as a lesbian in 1995 and later transitioned to living as a man. His transformation was chronicled in a book and a documentary feature, "Becoming Chaz."

The 2006 indie film "Transamerica" starred Felicity Huffman as a transgender woman taking a road trip with her long-lost teenage son. Huffman was nominated for an Academy Award for the role.

The 2006 indie film "Transamerica" starred Felicity Huffman as a transgender woman taking a road trip with her long-lost teenage son. Huffman was nominated for an Academy Award for the role.

Born female, Brandon Teena was living as a man in Nebraska when he was raped and killed by two men in 1993. Teena was 21. His case inspired the 1999 drama "Boys Don't Cry" starring Hilary Swank, who won an Oscar for her performance.

Born female, Brandon Teena was living as a man in Nebraska when he was raped and killed by two men in 1993. Teena was 21. His case inspired the 1999 drama "Boys Don't Cry" starring Hilary Swank, who won an Oscar for her performance.

Renee Richards, here in 2011, made headlines for undergoing a sex change while a professional tennis player in the 1970s. She was barred from playing as a woman in the 1976 U.S. Open but played in the tournament the next year after the New York state Supreme Court ruled in her favor and overturned the ban.

Renee Richards, here in 2011, made headlines for undergoing a sex change while a professional tennis player in the 1970s. She was barred from playing as a woman in the 1976 U.S. Open but played in the tournament the next year after the New York state Supreme Court ruled in her favor and overturned the ban.

Olympic gold medalist and reality TV star Bruce Jenner told ABC's Diane Sawyer, "Yes, for all intents and purposes, I'm a woman," during an interview that aired April 24. She has now made a highly publicized transition from male to female as Caitlyn Jenner.

Olympic gold medalist and reality TV star Bruce Jenner told ABC's Diane Sawyer, "Yes, for all intents and purposes, I'm a woman," during an interview that aired April 24. She has now made a highly publicized transition from male to female as Caitlyn Jenner.

The Girl Scouts of the United States of America now welcomes transgender girls, a stance that was made public several years ago but attracted controversy from conservative groups when it became widely known in May

Raffi Freedman-Gurspan is the first openly transgender White House staff member. She will serve as an outreach and recruitment director in the White House Office of Presidential Personnel.

Raffi Freedman-Gurspan is the first openly transgender White House staff member. She will serve as an outreach and recruitment director in the White House Office of Presidential Personnel.

It was rare for black models like Tracey "Africa" Norman to break into the cutthroat lily-white world of modeling in the 1970s. Norman, who had exclusive contracts for Avon skin care and Clairol's Born Beautiful hair color, didn't tell anyone she was also transgender and had been born male. Once her secret was out, the work dried up. Here are some other notable moments in the recent history of transgender identity.

It was rare for black models like Tracey "Africa" Norman to break into the cutthroat lily-white world of modeling in the 1970s. Norman, who had exclusive contracts for Avon skin care and Clairol's Born Beautiful hair color, didn't tell anyone she was also transgender and had been born male. Once her secret was out, the work dried up. Here are some other notable moments in the recent history of transgender identity.

"I started having a panic attack," he told CNN. "Teachers should never be following students to the bathroom unless they reek of cigarette smoke or alcohol."

He asked to be identified as R. because, like many transgender people, he does not want to publicly identify as transgender. He simply wants to spend his days in the skin he feels comfortable in.

Instead of returning to school less than three months before graduation, he enrolled in online classes for fear of being "outed." Now, he's threatening legal action against Horry County Schools to make sure other transgender students don't have to experience what he went through.

A case to test transgender rights

CNN could not independently confirm the student's claims, which were laid out in a demand letter from the Oakland, California-based Transgender Law Center sent Thursday on R.'s behalf. It appears to be the first test of last week's appeals court decision that upheld transgender students' rights to use bathrooms consistent with their gender identity.

In that case, the 4th Circuit Court of Appeals ruled on April 19 in favor of Gavin Grimm, a Virginia teen who claimed that the Gloucester County School Board violated Title IX , a federal law banning sex discrimination in schools, by preventing him from using boys' restrooms in school. The decision is binding on nine federal district courts in Maryland, Virginia, West Virginia, North Carolina and South Carolina, meaning judges are compelled to follow it as precedent.

It remains to be seen how lower courts in the conservative circuit will interpret the decision. In addition to school policy, it could impact legislation such as North Carolina's controversial law prohibiting transgender people from using public restrooms for the gender they identify with.

The decision created an opportunity to show that similar school district policies within the circuit are just as unconstitutional as Gloucester's policy, said Ilona Turner, legal director of the Transgender Law Center.

Horry County Schools Superintendent Rick Maxey would not comment specifically on the allegations but said the district is working to create a "welcoming environment."

"The district maintains the privacy of all of its students," Maxey said in an email. "The district seeks to accommodate the individual needs of its transgender students in compliance with the law, including Title IX. We will continue our efforts to ensure a welcoming school environment for all students."

After R. was suspended in January, a representative for the schools told CNN affiliate WMBF that the district does not have a specific policy on bathroom use for transgender students. The representative said the district makes accommodations based on individual needs and schools.

The Transgender Law Center's letter asks the school district to remove the suspension from R.'s record. It also asks the district to give transgender students access to facilities that match their gender identity and to ensure that all school staff respect the gender identity of transgender students. If the school does not comply within a week, center officials might file a complaint with the Department of Education, which enforces Title IX. Another option is to file a lawsuit in federal court, similar to the Grimm case.

"It's a very dangerous thing when we create these kinds of policies and laws intended to single out transgender people. They have the effect of policing everyone and placing gender under scrutiny," Turner said.

"Anyone who walks into a women's restroom who has short hair or appears less than totally feminine may have the police called on them or asked for their birth certificate."

'It was hard to understand'

For years, it appeared that the school was on board with R.'s gender identity, said the teen and his mother, who asked to go by Lynne.

Though he was born a girl, he resisted wearing dresses and began to show signs of identifying as a boy when he was 4, Lynne said.

It was difficult for her to accept initially, especially in a conservative community where traditional gender roles reign, but in the end she just wanted her son to be happy, she said.

"It was hard to understand what transgender was because I had never heard of it before," she said. "I had to get to place where I understood what that was and what it means."

By seventh grade, R. was shopping for clothes from the boys' section. Based on his appearance, girls in middle school began to complain when he used the girls' room. His family reached a decision with school administrators to use the boys' room to make everyone more comfortable, his mother said.

Since then, he has used the boys' room at school and in public places, Lynne said. Except for family and a few close friends, people at school knew him as a boy, until October. That's when a teacher found out he was born a girl and complained to administrators about him using the boys' room, the law center's letter states.

His mother met with school administrators and told them they had to let her son use the bathroom according to his gender identity. They disagreed and said that he must use the girls' room or that he could use the nurse's room, the letter says.

Using the girls' room was not an option, he said. He did not want to be outed after years of living as a boy. He chose the nurse's room to make it less obvious, but it soon proved onerous: The nurse's bathroom is on the first floor and most of his classes were on the second or third floors, he said.

Each time he went to the bathroom, he lost about 10 minutes in classroom time. Occasionally, to save time, he disobeyed the mandate and used the boys' room to save time.

"It was a lot of walking. I was always worried about how long I was out of the classroom," he said.

The worries turned into panic attacks at school, which were exacerbated by teachers who started using female pronouns to refer to him, according to the demand letter.

The January confrontation outside the bathroom was the tipping point, Lynne said. Instead of returning to school after the suspension, he enrolled in online courses. It was no longer just about the panic attacks or the inconvenience of using the nurse's bathroom, his mother said.

Join the conversation See the latest news and share your comments with CNN Health on Facebook and Twitter.

After years of treating him like a boy, the school was effectively outing him, she said.

"I was mad. I was angry, very angry that they would treat my child that way after all these years," she said. "I don't understand why it's important to dictate which bathroom they're allowed to use. I don't understand why people feel the need to control other people's lives."

Incidentally, R.'s progress in school has improved since he started classes online through the state, he said. His grades are better, and he's on track to finish classes ahead of time.

Regardless of whether the school grants his request, he feels a duty to future students to fix the situation.

"That's kind of my job, as a senior at the school," he said. "People should be able to use the bathroom in peace without being policed for using the right one or the wrong one."