United Airlines has apologised to a Muslim chaplain who said she was denied an unopened can of soft drink on an affiliated US domestic flight by an attendant who said it could be used as a weapon.

The US airline also said in a statement on Wednesday that the flight attendant had been banned from serving its customers.

United launched an investigation after Tahera Ahmad, Northwestern University associate chaplain, complained about the incident last week in social media posts that went viral.

Ahmad, who wore a headscarf aboard a flight from Chicago to Washington that was operated by Shuttle America for United, said in a Facebook post the flight attendant had discriminated against her when she was denied an unopened can of Diet Coke.

Ahmad's description of the incident touched off a social media storm, including a Twitter campaign at #UnitedforTahera, which garnered global support and a call by many to boycott the airline.

Ahmad did not immediately respond to a request for comment on Wednesday.

The attendant cited "security reasons", saying the beverage could be used as a weapon, yet gave the man sitting next to Ahmad an unopened can of beer.

Anti-Islamic comments

When she complained, Ahmad said, other passengers on the flight directed anti-Islamic comments at her.

Bob Birge, a spokesperson for Republic Airways Holdings, which operated the Shuttle America flight on behalf of United, said the airline's beverage policy did not ban serving unopened cans to passengers.

"While United did not operate the flight, Ms Ahmad was our customer and we apologise to her for what occurred on the flight," United Airlines said in a statement on Twitter.

"After investigating this matter, United has ensured that the flight attendant, a Shuttle America employee, will no longer serve United customers."

The airline said all its employees who dealt with customers underwent cultural awareness training at least once a year. It also said Shuttle America employees who worked with customers were trained in cultural sensitivity training, but did not specify how often.

"United does not tolerate behaviour that is discriminatory - or that appears to be discriminatory - against our customers or employees," the airline said.