Bill O'Reilly, longtime host of Fox News's top-rated show, "The O'Reilly Factor," was fired from the network in April 2017. His departure came after six women alleged he sexually harassed them. (Peter Stevenson/The Washington Post)

Rep. Maxine Waters (D-Calif.) has a heated history with Bill O’Reilly.

The combative TV host and commentator compared the African American lawmaker’s hair last month to a “James Brown wig” — then extended a cursory apology for his “jest,” calling his comments “dumb.”

Waters, from Los Angeles, forcefully dismissed O’Reilly and his remarks.

So perhaps it comes as no surprise that she is happy with how O’Reilly’s departure from Fox News went down.

Hours after 21st Century Fox made the decoupling official, CNN’s Anderson Cooper asked Waters: “Do you think Fox made the right decision to fire him today?”

“Absolutely, and I’m very proud of what I understand took place,” Waters replied, noting that, as she understood it, Rupert Murdoch’s sons had insisted the company cut ties with its prime-time star. “So I’m very pleased that they did that. I’m pleased with the advertisers who decided that they were going to pull their ads from his show.

“I’m so pleased with the women who came forward, who were victims and decided that they were going to expose what had happened to them. … This is an era of women who are fed up with being taken advantage of.”

Waters also took several direct shots at O’Reilly, who, she insisted, “is not going to be recorded favorably in history.”

The king of cable-news ratings needs help, she told Cooper.

“Unfortunately, he was a man who made tremendous sums of money, had a huge show, and really there’s something wrong with him psychologically,” Waters said on CNN. “He obviously could not sustain relationships. And the stories about him talking to women on the telephone with this kind of sex talk, it is really, just, you know, unconscionable that he would allow himself to end up like this. It’s all his fault.”

“So I hope he seeks some help,” she added. “And I hope that the women who have come forward feel good about the justice that they’re receiving.”

Waters has been vocal about women’s rights in the past. After O’Reilly’s affront last month, she said she would not stand for “intimidation” — and that other women shouldn’t either.

“Let me just say this: I’m a strong black woman and I cannot be intimidated. I cannot be undermined. I cannot be thought to be afraid of Bill O’Reilly or anybody,” she said on MSNBC. “And I’d like to say to women out there everywhere: Don’t allow these right-wing talking heads, these dishonorable people, to intimidate you or scare you. Be who you are. Do what you do. And let us get on with discussing the real issues of this country.”

Earlier this month, amid O’Reilly’s sexual harassment scandal, Waters again appeared on MSNBC to say her favorite Fox News target should be behind bars.

“It shouldn’t be in America that you can sexually harass women and then buy your way out of it because you’re rich,” Waters said. “If they continue to do this in the way that they have done they need to go to jail.”

As The Washington Post’s Amy B Wang reported, the height of tension between O’Reilly and Waters came in late March during a “Fox & Friends” segment, when footage was rolling from a speech Waters had delivered on the House floor.

In it, she defended those who have expressed criticism of President Trump, saying: “We have suffered discrimination. We have suffered isolation and undermining. But we stand up for America, often times when others who think they are more patriotic, who say they are more patriotic, do not.”

O’Reilly’s face appeared in a smaller window on the screen, where he was shown smiling, pumping his fist and mouthing silent responses to Waters.

“When we fight against this president and we point out how dangerous he is for this society and for this country, we’re fighting for the democracy. We’re fighting for America,” Waters continued. “We’re saying to those who say they’re patriotic, but they turned a blind eye to the destruction he’s about to cause this country: ‘You’re not nearly as patriotic as we are.’ ”

After watching the clip, O’Reilly’s colleagues asked him what he made of the floor speech.

“I — I didn’t hear a word she said,” O’Reilly told them. “I was looking at the James Brown wig.”

One of the hosts laughed loudly before co-host Ainsley Earhardt tried to defend Waters, saying: “No. Okay, I’ve got to defend her on that. I have to defend her on that. You can’t go after a woman’s looks. I think she’s very attractive.”

“I didn’t say she wasn’t attractive,” O’Reilly said.

“Her hair is pretty,” Earhardt insisted.

“I love James Brown, but it’s the same hair, James Brown — all right, the godfather of soul — had,” O’Reilly replied.

“So he had girl hair,” Earhardt said.

“Whatever it is,” O’Reilly said, “I just couldn’t get by it.”

Waters, 78, was first elected to Congress in 1991.

The ranking Democrat on the House Financial Services Committee has become one of the harshest and most unapologetic critics of Trump, openly calling for his impeachment.

As the clip made the rounds online, people decried O’Reilly’s comments as “sexist” and “openly racist.”

“Go straight to hell,” CNN commentator Angela Rye tweeted to O’Reilly.

Amy B Wang contributed to this report.

Read more:

‘Stay strong, Papa Bear’: Stephen Colbert bids a ‘fond’ farewell to Bill O’Reilly

Bill O’Reilly and the powerful men accused of preying on women in the workplace