Freedom of speech and of the press as we understand them today did not spring wholly formed from the minds of the Founders. For more than a century after it was enacted, the First Amendment received little more than lip service. John Adams imprisoned his critics under the Sedition Act, as did Abraham Lincoln during the Civil War. The Socialist leader Eugene V. Debs was locked up for opposing American involvement in World War I — which didn’t stop him from receiving nearly a million votes in the 1920 presidential election.

Now we have a president who threatens to turn back the clock. Donald Trump has said he would “open up those libel laws” and has declared that the press is “the enemy of the American People!” As if that weren’t chilling enough, The Hill reports that “Republican state legislators across the country are advancing bills that would criminalize or penalize some public protests.”

It’s a frightening moment. To refresh my understanding of what the First Amendment truly means, I recently re-read Anthony Lewis’ magnificent 2007 book “Freedom for the Thought That We Hate: A Biography of the First Amendment.” I’m glad I did. The late New York Times columnist, who was married to former Massachusetts Supreme Judicial Court chief justice Margaret Marshall, was a giant in his understanding of and reverence for the right to speak and write freely.

The story of how the meaning of the First Amendment changed over time is rooted in the emergence of modern governmental and business institutions during the 20th century. As Paul Starr argued in his 2005 book “The Creation of the Media,” the First Amendment rulings issued by the Supreme Court were needed in order to empower the institutional press with the legal protections it needed to hold other powerful institutions to account.

How the court accomplished that is told by Lewis in clear, lucid prose, as he leads us through the human drama of interactions between the justices, of the evolution of Oliver Wendell Holmes Jr., and of the principled, prescient stands taken by Holmes’ frequent ally Louis Brandeis.

Lewis reminds us that the rise of the First Amendment is a classic example of how judges apply broad principles to changing circumstances — a lesson that can’t be emphasized enough given the dominance of conservative justices such as the late Antonin Scalia, who argued that the Constitution must be interpreted as it was written. The problem, Lewis writes, is in “finding an original intention when the authors or supporters of a clause in the Constitution had not expressed one, indeed had not even imagined the problem now at issue.”

Perhaps the most important of the court’s First Amendment decisions was Gitlow v. New York (1925), in which a radical named Benjamin Gitlow was sentenced under New York’s criminal anarchy law for writing a turgid piece of agit-prop called the “Left Wing Manifesto.” The Supreme Court upheld Gitlow’s conviction — but in doing so ruled for the first time that the equal-protection guarantees of the 14th Amendment meant that state and local governments were forbidden from violating the First Amendment. Up to that point, “Congress shall make no law … abridging the freedom of speech, or of the press” had meant exactly that. States had been free to violate those rights with impunity.

All of the other great First Amendment protections flowed from Gitlow, as the court used its authority to expand freedom in the face of repression emanating from the states. Near v. Minnesota (1931) prohibited prior restraint — censorship — with very few exceptions, paving the way for the publication of the Pentagon Papers and the Snowden documents. New York Times v. Sullivan (1964) prohibited public officials from using libel laws to punish the press in the absence of egregious and deliberate falsehoods. Brandenburg v. Ohio (1969) guaranteed the right to protest unless there was a serious and imminent threat of violence.

The one major issue on which the press fell short was the right to protect anonymous sources, which was rejected by a divided court in Branzburg v. Hayes (1972). Although 49 states offer some protections, the federal government does not. And we can see the deleterious effects of that in the form of Barack Obama’s attempts to force journalists to reveal who had leaked them information — attempts that may fade in comparison to the fury that President Trump has unleashed.

“The story of the First Amendment is powerful testimony to the crucial role of judges in a political system that rests on a foundation of law,” Lewis writes. “Voters are the ultimate sovereigns in a republic, as James Madison and the other Framers of the Constitution said. But transient political majorities cannot be expected to articulate the fundamental values of a constitution, least of all when the majority’s immediate interest conflicts with those values — as, from time to time, it will.”

The press’ power to hold government accountable is especially important during times when Congress lacks the courage or the will to do so itself. Lewis cites the media’s role in exposing the George W. Bush administration’s secret surveillance program and its use of torture against suspected terrorists. Now, with a Republican Congress disinclined to ask tough questions about the Trump administration’s ties to Russia and a host of other issues, it is vital that we maintain a free and independent press.

“I am convinced,” Lewis writes, “that the fundamental American commitment to free speech, to disturbing speech, is no longer in doubt.” Let’s hope he’s right.

Correction: This post has been revised to reflect the fact that John Adams imprisoned his critics under the Sedition Act, not the Espionage Act.