The Princeton University campus in Princeton, N.J. (Seth Wenig/AP)

Bruce D. Brown is executive director of the Reporters Committee for Freedom of the Press.

Imagine if Congress put a special tax on the advertising revenue of the largest newspapers. Lawmakers denounced them for conducting a “vicious campaign” against their political patron, a populist strongman. “A tax on lying,” they called it.

Congress has never passed such a law, but in 1934, Huey Long’s Louisiana did. The Supreme Court struck it down two years later as a violation of the First Amendment in Grosjean v. American Press Co.

Today, Grosjean is the starting point for any clash between the taxing power and free speech. And such a collision looks a lot more likely given the new excise tax on select private university endowments written into last year’s tax bill. The provision is much more than a slap at wealthy colleges or a way to help pay for corporate tax cuts, as it has so far been portrayed.

The entire nonprofit sector is now on notice that the long-standing bargain between them and the federal government — they can pursue their public- ­interest missions, free of taxation, as long as they stay out of electioneering — is potentially gone. And this financial threat could not be hovering over nonprofits at a worse time.

Nonprofits make up a big part of what we call civil society. This universe extends well beyond college quads to think tanks, advocacy organizations, arts institutions, scientific bodies and a growing number of news organizations, including such influential outlets as ­ProPublica.

With civil society confronting the enormous task of defending democratic norms in the Trump years, the nonprofit world is more important than ever. Although Grosjean involved a tax on newspapers, not universities, the Supreme Court has recognized that academic freedom, like freedom of the press, is a “special concern” of the First Amendment. The tax on college endowments is a dangerous development for all nonprofits.

Conservatives have aspired for some time to take a torch to what they perceive as the elitist, left-leaning wall that rings academia. But even in the absence of a censorial motive, a second tax case, also involving the press, provides strong ammunition to challenge the new law.

In the early 1970s, Minnesota enacted a special tax on the cost of the paper and ink used to print newspapers. The law exempted the first $100,000, which effectively limited the tax to the state’s dozen or so largest papers.

Unlike in Grosjean, no intent to punish viewpoint through taxation was evident. But the U.S. Supreme Court found that two key aspects of the Minnesota tax violated the First Amendment: The state had targeted the press among all industries and tailored the law to affect only certain newspapers.

“Recognizing a power in the State not only to single out the press but also to tailor the tax so that it singles out a few members of the press presents such a potential for abuse that no interest . . . can justify the scheme,” wrote Justice Sandra Day O’Connor in Minneapolis Star v. Minnesota Commissioner.

With the new 1.4 percent excise tax on endowment earnings, Congress has gone down a similarly dubious path. It set its sights on higher education among all nonprofits. It then focused on a subset of about 30 institutions — only those that enroll at least 500 students and have an endowment of at least $500,000 per student.

And then it made good on the “potential for abuse” by carving out a single institution, Berea College of Kentucky, home state of Senate Majority Leader Mitch McConnell (R), by creating an exemption so the tax would reach only schools that charge tuition; Berea’s students attend free.

This kind of pork politics might play in general economic regulation, where we expect the sausage-making to be messy. But when universities are targeted with special taxes, unevenly applied, it’s hard for lawmakers to claim that their actions are entirely unrelated to limiting academic freedom — and thus suppressing the crucial role it plays in our democracy. As O’Connor put it, the threat of taxation “can operate as effectively as a censor to check critical comment.”

The backers of the excise tax say that they are simply trying to encourage the richest schools to use more of their endowments to reduce tuition or provide scholarships. But among the ­singled-out schools are those that hand out the most financial aid, thanks to the endowments now being taxed. And Congress is not exactly taking the new revenue and plowing it back into tuition assistance. Even a fan of the tax, conservative columnist Ross Douthat, admitted that it is “more of a targeted culture-war jab.”

Special taxes on universities — or on any part of the noisy nonprofit public square — are highly suspect: The urge for elected officials to use them to squeeze First Amendment-protected activity is just too great. The new excise tax has a long heritage and deserves a short life.