A disruptive passenger on a United Airlines flight from Shanghai to New Jersey was asked to get off the plane in a politically tinged altercation, resulting in an unscheduled stop in San Francisco and an arrival delayed by eight hours.

Video on social media showed an unidentified man wearing a red "Make America Great Again" cap heatedly insisting that he was entitled to a seat and arguing with fellow passengers, at one point calling one a "moron" who didn't speak English.

The caps were popular in President Donald Trump's campaign.

Sunday's incident ended with local airport authorities escorting the man off the plane while angry passengers chanted "Lock him up," cellphone footage showed. The chants likely also referred to the bitter election, when Trump frequently led chants of "Lock her up" about his rival, Hillary Clinton, who was accused of mishandling emails as secretary of state.

Passenger Clark Gredona wrote on Facebook that the man felt entitled to several seats next to him because he could not get an upgrade. He berated a female passenger by calling her "Hillary" and a "lesbian," Gredona wrote.

Elizabeth Aulenbach, a passenger who was sitting three rows ahead of the disruptive man, told The Associated Press that the incident didn't start as a political dispute but was exacerbated by the "Democratic-Republican fire that rages."

"He just wanted United to do something, anything, that would allow him to sue them — he even said so more than once," said Aulenbach, who was flying home to Pennsylvania. She added that United crew behaved professionally.

The airline has been in the spotlight in recent weeks after footage surfaced of a passenger being violently dragged off an overbooked flight from Chicago to Louisville, prompting widespread condemnation and an undisclosed legal settlement.

United spokesman Jonathan Guerin said the disruptive passenger in Shanghai "refused to comply with crew member instructions" and eventually left the aircraft on his own accord.

The flight departed Shanghai five hours after its scheduled takeoff and made an unscheduled stop in San Francisco to change crew. It arrived in Newark at 2:25 a.m. Monday, eight hours after its scheduled landing time.

"We're grateful for the patience shown by our customers who endured the disruptive behavior of this passenger, as well as the exceptional poise and professionalism of our flight crew," Guerin said.