The pilot, Dale Robin Hirsch, raised his middle finger at police at the Sao Paulo International Airport to protest recently introduced Brazilian security measures that require US citizens to be fingerprinted and photographed upon entering the country.
The Brazilian measure introduced from 1 January was in retaliation for a similar US procedure, which requires fingerprinting and photographing visitors who need visas for the US.
Visitors to the US have often complained of "harassment" at American airports.
"Hirsch behaved in a mocking manner toward federal police and made an internationally recognised obscene gesture while he was being photographed for identification," Sao Paulo's police chief, Francisco Baltazar da Silva said.
Ten crew members from the same American Airlines flight 907 from Miami were also denied entry to Brazil after refusing to cooperate with security officials.
American Airlines said it regretted the incident and was looking into the matter.
"The company apologises to the Brazilian government, the airport authorities, the police, or anyone else who perceived anything they believed to have been disrespectful," the airline said in a statement.
"The captain and other crew members certainly meant no disrespect," it added.
The incident came a day after Brazilian President Luiz Inacio Lula da Silva appealed to US President George Bush to suspend visa requirements so the two countries could drop the fingerprint checks.