Maggie Gyllenhaal felt ''guilty'' when she learned she was getting equal pay as her co-star James Franco on 'The Deuce'.

The 41-year-old actress produces and stars in the HBO series, but has admitted she still had a moment where she felt like it wasn't ''fair'' that she was being paid the same amount as her co-star James, and says she has been ''brainwashed'' to accept the fact that women get paid less than men.

She said: ''Yeah, that was so interesting actually. I just, out of the blue, got a phone call saying that HBO was going to significantly raise my salary. And, I'm going to be totally honest here, the first feeling I had was I felt kind of guilty. I just had this windfall: 'You know, wait, that's not fair.' But that's where I'm brainwashed.''

Maggie says it took her ''a while'' to come to terms with the news, because she spent too much time ''justifying this confused logic''.

She added: ''That's where I'm like, 'I don't deserve this' and all this stuff. Like, 'Well, he is way more bankable and so he is going to ...' and that I've been told my entire career. It took me maybe a day to go like, 'No, no, no, this is payback for a long time. When have I ever been paid the same as my male costar?'

''It took me a while to kind of clear my head. Because I think I spent a lot of time justifying this confused logic.''

The 'Donnie Darko' star also praised HBO for the way they handled the explicit series, as well as the sexual misconduct allegations against James.

Speaking to SiriusXM's John Fugelsang, Maggie said: ''So, that was amazing and I think HBO in general has been so incredibly intelligent about the way they have dealt with the accusations against James, the very complicated nuanced politics of our show, the nudity, having an intimacy coordinator. All of it, I just think HBO has been incredible.''