A gate agent barred two girls in their early teens from boarding a United Airlines flight Sunday morning from Denver to the Twin Cities because the leggings they were wearing were deemed improper, a witness and an airline spokesman said.

Another girl, roughly 10 years old, also was singled out for having on leggings, but she put on a dress from her backpack and was allowed to board, said Shannon Watts, a traveler who witnessed the incident at Denver International Airport.

“She looked normal and appropriate” before covering up, Watts said of the youngest of the girls.

The older girls “did not have any other clothing,” Watts said. “[They] were turned away.”

The female agent explained to the young travelers that they “can’t get on the plane wearing Spandex,” said Watts, on her way to Mexico for a vacation. “[The agent] said she doesn’t make the rules, she only follows them.”

United spokesman Jonathan Guerin said the two who were turned away were standby “pass riders,” meaning they were traveling as relatives of an employee, and their “attire did not meet our [more strict] pass travel requirements. … They are representing United Airlines.”

The two teenagers took a later flight after agreeing to change their clothing, the spokesman said.

Guerin said he had no information about the younger girl and whether she was given the same ultimatum, but he said the gate agent would have had the discretion to decide whether the girl was dressed properly before boarding.

But in general, for travelers who are not relatives of employees, Guerin said, “If you are a customer and want to wear your yoga pants, welcome aboard.”

Watts took to Twitter as the conflict unfolded and questioned what gave United the right to scrutinize the girls’ attire.

“This behavior is sexist and sexualizes young girls,” she wrote. “Not to mention that the families were mortified and inconvenienced.”

United replied on Twitter, saying, “We do have the right to refuse transport for passengers who are barefoot or not properly clothed.” The provision cited by the airline, which is part of the standard airline/passenger contract, does not define “properly clothed.”

Others on Twitter contacted United with their objections, which were met with a reply that “when passengers purchase a ticket, they are agreeing to a contract.”

Watts said she flies a lot, particularly on United, and has “never, never” seen such scrutiny.

“I’ve got four daughters of my own,” said Watts, who lives in the Denver area and is founder of Moms Demand Action, a national gun safety advocacy group. “This was normal athletic wear. It’s what I would wear. … I’ve worn yoga pants with a pair of sneakers.”

Disputes over certain styles of leggings have been popping up for years in the Twin Cities and elsewhere. In Barrington, R.I., last October, hundreds of women, girls and other supporters proudly donned their yoga pants as they paraded around the neighborhood of a man who derided the attire as tacky and ridiculous.

In 2012, then-Minnetonka High School Principal Dave Adney created a media frenzy when he urged parents to dissuade their daughters from wearing what he called “high-definition pants.”

Adney’s message of “cover your butts up … we’re seeing too much” prompted interview requests from ABC-TV’s “Good Morning America” and the Boston Globe and turned the now-former Minnetonka principal into something of a reluctant pop culture hero.