Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

United Airlines faced backlash from customers Sunday after two girls wearing leggings were denied entry onto a flight because a gate agent deemed their attire improper.

The incident, documented on Twitter by Colorado resident and anti-gun activist Shannon Watts, took place in the waiting area outside a gate for a flight to Minneapolis at Denver International Airport.

Watts said she was waiting to board a plane to Mexico for a vacation when she overheard a female gate agent denying entry to a young girl wearing gray leggings and saying: "I don't make the rules. I just enforce them."

The girl, who Watts said was about 10 or 11 years old, had a dress in her backpack to put over leggings and was eventually allowed onto the flight. Two other female passengers who didn't have changes of clothes were also denied entry, she said.

2) She's forcing them to change or put dresses on over leggings or they can't board. Since when does @united police women's clothing? — Shannon Watts (@shannonrwatts) March 26, 2017

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

A spokesman for United Airlines, Jonathan Guerin, told NBC News that the women included two teens. The two women denied entry were flying as "pass travelers," meaning they were relatives or friends of a United Airlines employee.

All three remained in Denver to make other travel arrangements because they didn't want to split up, Guerin said.

NBC News wasn't immediately able to locate the passengers at the center of the controversy.

Defending the decision on Twitter, United Airlines initially cited a rule in the company's Contract of Carriage, which states that the company can refuse transportation to "passengers who are barefoot or not properly clothed" and that it is "left to the discretion of the agents." In its contract, however, the airline doesn't define "proper clothing."

"United shall have the right to refuse passengers who are not properly clothed via our Contract of Carriage," the company said in a tweet.

@shannonrwatts (2/2) There is a dress code for pass travelers as they are representing UA when they fly. ^KP — United (@united) March 26, 2017

Guerin called the gate agent's actions appropriate and said that because the women were flying as "pass riders," their attire didn't meet the airline's stricter requirements for such travelers. Had the women been regular passengers, he said, they would have been permitted to wear yoga pants and leggings.

"When traveling as a United pass traveler, we always remind our family and friends there are rules we all need to follow. We remind them that they are representing United Airlines," he said.

Social media users were quick to condemn the company, calling the policy everything from sexist to a promotion of body shaming. Some said they would boycott the airline.

The episode was personal for Watts, a mother of four daughters and founder of the gun safety advocacy group Moms Demand Action.

"I have five kids: four of them are women," Watts said in an email to NBC News. "They wear yoga pants all of the time when flying. As a Premiere United flier, I think this policy is arbitrary and sexist. It singles out women for their clothing and sexualizes little girls."

ATTENTION TRAVELERS here is United Airlines new dress code for women pic.twitter.com/7t1M0pbY6F — psedoali (@psedoali) March 26, 2017

I'm actually flying United Airlines this afternoon. I will be wearing leggings in protest. @united your staff needs training — Dwayne Benjamin (@dwaynebenji) March 26, 2017

Hey United Airlines, we’ll take your 1960s dress code seriously when you stop charging $15 for a sandwich that tastes like regret. — Thistallawkwardgirl (@thistallawkgirl) March 26, 2017