President Biden argues that his ambitious domestic agenda — totaling some $6 trillion — is necessary to keep up with our primary geopolitical rival. As he told Congress last week: “We’re in competition with China and other countries to win the 21st century.”

In so doing, Biden harked back to the Cold War, when national security was often used as a justification for initiatives that had little to do with the Pentagon. In asking Congress in 1955 to fund a national network of highways, President Dwight D. Eisenhower cited the need, “in case of an atomic attack on our key cities,” to have a road network that would “permit quick evacuation of target areas, mobilization of defense forces and maintenance of every essential economic function.” In announcing in 1961 his audacious goal “of landing a man on the moon and returning him safely to earth,” President John F. Kennedy cited the need “to win the battle that is now going on around the world between freedom and tyranny.”

Even the struggle for civil rights was often seen as a Cold War imperative. The Justice Department, in asking the Supreme Court to overturn school segregation in the 1954 case of Brown v. Board of Education, wrote: “It is in the context of the present world struggle between freedom and tyranny that the problem of racial discrimination must be viewed.”

The Cold War did not just help to get highways built, land a man on the moon and curb racial segregation. It also led to increased spending for scientific and technological research and education along with foreign language study. Technological spinoffs from Cold War defense and space spending include the Internet, GPS, solar panels, memory foam and even handheld vacuum cleaners.

The Cold War also produced cultural benefits. To win the competition for “hearts and minds” with the Communist bloc, the U.S. government sponsored global tours by jazz musicians and international exhibitions of abstract art, smuggled samizdat literature out of the Soviet Union (e.g., “Doctor Zhivago”), and covertly sponsored the highbrow magazine Encounter.

So, too, the competition with China today can pay major dividends if properly managed — but that’s a big if. It can be an impetus to advances in quantum computing, artificial intelligence, unmanned systems, semiconductors, biotechnology, and other cutting-edge fields that have both military and civilian applications. It can spur greater investment in building a fairer and more broadly prosperous society at home, as Biden proposes. And it should lead the U.S. government to promote U.S. culture abroad while also helping dissident Chinese writers, artists, activists and filmmakers to get their message out despite Beijing’s censorship.

But the dark side of the Cold War should serve as a warning of how such competition, if it runs amok, can threaten our liberties and our lives. Domestically, fear of Communism led to Sen. Joseph McCarthy’s witch hunts, unethical CIA experiments involving LSD and illegal letter-opening, and the FBI surveillance and harassment of antiwar activists and civil rights leaders such as the Rev. Martin Luther King Jr. Abroad, fear of communism led the U.S. government to make common cause with brutal regimes from Zaire to Indonesia, to help overthrow democratically elected leaders in Iran and Chile, to become embroiled in costly conflicts in Korea and Vietnam, and even to work with the mafia to assassinate Cuban strongman Fidel Castro. Worst of all, the confrontation with the Soviet Union almost led to nuclear annihilation in the 1962 Cuban Missile Crisis and in the 1983 Able Archer crisis (when the Soviets nearly mistook a NATO nuclear exercise for an actual attack).

President Donald Trump often seemed determined to emulate the worst excesses of the Cold War by feeding anti-Chinese hysteria. He called covid-19 “kung flu,” helping to increase anti-Asian animus and hate crimes. He launched a trade war with China that hurt our economy. He rescinded the visas of 1,000 Chinese graduate students and researchers supposedly linked to the Chinese military. He launched prosecutions of researchers who were accused of covert links with China. He expelled Chinese journalists. He imposed visa restrictions on the Chinese Communist Party’s 92 million members (most of them ordinary bureaucrats) and their relatives. He closed down the Peace Corps and Fulbright programs in China.

Most of these Trumpian initiatives — from the shuttered Peace Corps to the costly tariffs — remain in place. Biden would be well advised, as veteran Beijing correspondent Ian Johnson argued in the New York Times, to undo many of these counterproductive policies “to reverse the downward spiral in the two countries’ relations.”

While reducing unnecessary friction, Biden should do far more than Trump to highlight Chinese human rights abuses, just as Presidents Jimmy Carter and Ronald Reagan did with the Soviet Union. Biden also needs to counter Chinese military aggression in the South China Sea and the Taiwan Strait while maintaining open lines of communication with Beijing to avert a war that neither country wants.

While the competition with China is far different from the Cold War with the Soviet Union, it still offers useful lessons in what to do — and what not to do.

Read more: