Oscar-nominated US actress Maggie Gyllenhaal

Oscar-nominated US actress Maggie Gyllenhaal was told she was too old at 37 to play the lover of a 55-year-old man, she said in comments published Thursday which went viral online.

"There are things that are really disappointing about being an actress in Hollywood that surprise me all the time," she said in an interview with TheWrap Magazine.

"I'm 37 and I was told recently I was too old to play the lover of a man who was 55. It was astonishing to me. It made me feel bad and then it made feel angry, and then it made me laugh."

The remarks immediately trended on Twitter and Facebook, with salon.com commenting that the incident "lays bare just how delusional and hilariously sexist Hollywood truly is."

Earlier this month the American Civil Liberties Union (ACLU) called for government action to confront "widespread exclusion of women directors" in the US film and television industries.

In letters to federal and California state civil rights authorities, it said women directors face "a systematic pattern and practice of discrimination and exclusion" that cannot be allowed to stand.

In 2014, it said, women accounted for only seven percent of directors on the year's top 250 grossing films, down two percentage points from 1998.

Gyllenhaal, the older sister of actor Jake Gyllenhaal, was nominated for an Academy Award for 2009's "Crazy Heart." Her brother won an Oscar nod for 2005's "Brokeback Mountain."