The American Civil Liberties Union is suing Metro, alleging the transit agency’s restrictions on “issues-oriented” advertisements violate the First Amendment.

The lawsuit also challenges Metro’s rejection of ad campaigns representing a wide political spectrum: the abortion provider Carafem, PETA, alt-right writer Milo Yiannopoulos and the ACLU itself.

The lawsuit, filed Wednesday in U.S. District Court in D.C., centers on four ads: a PETA ad that encouraged people to “Go Vegan,” an ad for an FDA-approved abortion pill, a promo for a book by Yiannopoulos, and an ACLU campaign that highlighted a quote from the First ­Amendment.

All were either rejected outright by Metro — based on its advertising guidelines that prohibit ads that are “intended to influence members of the public regarding an issue on which there are varying opinions” — or were retroactively pulled from stations, trains and buses after riders complained.

“In its zeal to avoid hosting offensive and hateful speech, the government has eliminated speech that makes us think, including the text of the First Amendment itself,” Lee Rowland, senior staff attorney with the ACLU, said in a statement Wednesday.

The ACLU wants Metro to post the rejected ads and eliminate components of its guidelines that ban issues-oriented ads or limit medical and health-related advertising.

Metro said Wednesday it continues to believe its current policy is the correct approach.

Metro “intends to vigorously defend its commercial advertising guidelines, which are reasonable and viewpoint neutral,” spokeswoman Sherri Ly said.

Many customers and others agreed that Metro’s decision to remove the ads was the right choice. On Wednesday, some expressed outrage that the ACLU would defend Yiannopoulos, a controversial conservative writer and political figure who has espoused views that many believe are racist, xenophobic and sexist.

“I understand the ACLU has to protect the worst speech,” Democratic congressional candidate Brianna Wu, of Massachusetts, tweeted to her 72,000 Twitter followers, “but the day they work for Milo is the day I decide to never give them another dime.”

But ACLU officials said the organization is suing based on the principle that whether or not you agree with a viewpoint, individuals have the right to express it.

“The ACLU could not more strongly disagree with the values that Milo Yiannopoulos espouses,” Rowland said in explaining the decision, “but we can’t allow the government to pick and choose which viewpoints are acceptable.”

The lawsuit is the latest installment in a years-long effort by Metro — and transit agencies around the country — to develop an advertising policy that strikes a balance between curtailing hate speech and adhering to the values of free speech.

Advertising is a significant revenue source for Metro. This year, the agency expects to make $24 million — or 1.3 percent of its operating budget — through advertising sales, and officials are looking for ways to increase those numbers.

The system’s location in the nation’s capital makes it prime real estate for those who want to make political statements, and it has often been at the center of such disputes since its opening 40 years ago — from posters that criticized President Ronald Reagan and the Catholic Church, to those advocating the legalization of marijuana, to the antiabortion movement.

But it wasn’t until 2015 that the Metro board instituted sweeping changes to its advertising policy that gave officials wide latitude to reject ads. The changes were prompted by an ad from a controversial pro-Israel group called the American Freedom Defense Initiative, which wanted to post ads depicting a caricature of the prophet Muhammad. Many Muslims consider such depictions to be blasphemous.

Weeks earlier, the same cartoon had been at the center of a deadly shooting in Texas, where two men opened fire outside of an event where the cartoon was prominently displayed as part of a contest. Metro officials said they wanted to prevent the possibility of a similar reaction here, and so they instituted wide-ranging guidelines that prohibited ads that are political, religious or “intended to influence public policy.”

But the intentionally broad guidelines have caused frequent run-ins related to ads that many view as controversial.

In the case of Yiannopoulos’s book, the advertisement featuring the author’s face and the title of the book, “Dangerous,” made it past Metro’s censors, and it was posted at stations and on trains. Rider complaints poured into the agency.

Days later, Metro removed the ads. Soon after, the ACLU reached out to contact Yiannopoulos about legal action.

“It wasn’t an accident that we put these four clients in one case together, precisely because of the message we thought that would send,” said Arthur Spitzer, legal director of the ACLU-D.C. and lead counsel in the case. “We wanted to make a point to the court and the public that we weren’t just trying to get out some particular point of view.”

He also called it “ironic” that Metro also rejected the ACLU’s own ads, which showed the First Amendment of the U.S. Constitution in English, Arabic and ­Spanish.

The ACLU said Metro is enforcing its advertising guidelines capriciously and the prohibitions outlined in the guidelines are too broad and wide-reaching.

The organization noted that any advertisement could potentially violate Metro’s policy.

“By rejecting these ads and accepting ads from gambling casinos, military contractors, and Internet sex apps, the [Washington Metropolitan Area Transit Authority] showed just how subjective its ban is,” the statement said.

Carafem, the company whose ads for abortion pills were rejected by Metro, said it is a health-care provider, not an advocacy group, meaning its ads do not violate Metro’s policy.

“The abortion pill is, of course, both FDA-approved and accepted by the American Medical Association,” Melissa Grant, ­Carafem’s chief operations officer, said in a statement. “We’re publicizing our services like any other health care provider.”

Rebecca Tushnet, a professor of First Amendment law at Harvard Law School, said the ACLU’s case against Metro is “extremely strong.”

“They [WMATA] do seem to be acting pretty inconsistently, and they seem to not have a clear policy,” she said. “For a government institution that decides to have advertising, for better or for worse, you can’t have your standards for what is allowable based on the identity of the person in the advertisement.”

Tushnet said Metro should consider changing its policy to something more narrowly tailored and specific.

“You could write a better policy that accomplishes much of the same goal,” Tushnet said.

But Spitzer said Metro should consider reverting to its pre-2015 policy. After all, he said, advertising space on a public transit system is a particularly precious space to encourage the free exchange of ideas — even unpopular ones.

“We’re living at a time when people more and more just visit websites they agree with and watch television they agree with and share things on Facebook with people who agree with them,” Spitzer said. “Metro advertising is a very vital way to reach people who you might not otherwise reach. . . . To shut off any venue to any advertising that makes people think — that seems particularly unfortunate.”