Director Inarritu insisted afterwards that Penn's remark was nothing more than a brutal joke between old friends

'The struggles people endure for immigration justice are not punchlines,' tweeted one person

Many on social media found Penn's 'joke' to be bad taste and

Sean Penn is in hot water over remarks he made about a ‘green card’ into relation to Mexican-born Oscar-winner Alejandro Inarritu who won Sunday night’s Oscar for best director.

Penn arrived on stage at the end of the Sunday's Academy Awards telecast to hand out the award for best film.

In announcing the win for Birdman, Penn asked, 'Who gave this son of a bitch his green card? Birdman.'

Sean Penn is in hot water over remarks he made about a ‘green card’ into relation to Mexican-born Oscar-winner Alejandro Inarritu who won Sunday night’s Oscar for best director

One of the first to call Penn out was filmmaker and immigration activist Jose Antonio Vargas

Twitter quickly went into meltdown with users denouncing Penn’s ill-judged ‘joke’ as 'insensitive' to the plight of many immigrants in the United States and 'racist.'

One of the first to call Penn out was filmmaker and immigration activist Jose Antonio Vargas.

'Mexican director = green card joke. Not funny, just plain xenophobic. Wtf, Sean Penn?!' he tweeted.

Others, including TV presenter Mario Lopez, pointed out that the comment was made about a Mexican while no one questioned the immigration status of the countless British and Australian actors in attendance.

The term 'green card' refers to a document that confers permanent residency to immigrants in the United States.

While the remark about Inarritu's immigration status struck many as an insult, the director insisted it was nothing more than a brutal joke between old friends.

'I found it hilarious,' Inarritu said after the ceremony. 'Sean and I have that kind of brutal (relationship) where only true friendship can survive.'

Penn's ill-judged attempt at humor was considered racial insensitive by a number of people on Twitter

Other people commented that no one would make such a racial-charged 'joke' about the countless Brits and Australians present at the event

Inarritu directed Penn in his 2003 film 21 Grams, and the pair remain friends. Penn posed for pictures with Inarritu after the ceremony.

The director, who won three Oscars on Sunday night, said he has told many similarly brutal jokes at Penn's expense. 'I make on him a lot of very tough jokes that I will not tell you,' Inarritu said.

Joke or not, the remark struck many online as problematic for an awards ceremony that had been criticized for not having more nominees of color.

Inarritu joked that after his three wins on Sunday night, the Academy of Motion Picture Arts and Sciences might institute a residency requirement.

His win in the best directing category marks back-to-back wins for Mexican-born directors; last year Alfonso Cuaron won that honor for Gravity.

TV presenter Mario Lopez was quick to point out that the comment was made about a Mexican while no one questioned the immigration status of the countless British and Australian actors in attendance

Director Alejandro Inarritu, seated, insisted afterwards that Penn's remark was nothing more than a brutal joke between old friends

'Maybe next year, the government will inflict some immigration rules (on) the academy. Two Mexicans in a row, that's suspicious, I guess.'

It took some of the sting out of Penn's words, but Inarritu also used the opportunity of having some of the last words in the Oscar telecast to celebrate immigrants.

The director called on his fellow Mexicans to build a better government, and said those who have come to the United States should be afforded the respect that previous generations of immigrants have been given.

'I want to dedicate this award for my fellow Mexicans, the ones who live in Mexico,' Inarritu said.