A Boston man has been charged with two counts of lewdness after police say he exposed himself to two women on the Red Line.

Two women riding the Red Line on March 27 told transit police that a man sitting across from them had intentionally exposed his genitals. They also said they saw him try to grope a woman as he walked up the stairs, according to MBTA police.

Transit detectives arrested Robert McCarty, 40, and charged him with two counts of open and gross lewdness. Police say he was apprehended at the Harvard Square stop.

McCarthy was arraigned in Boston Municipal Court-Central Division, according to transit police.