The writer is a professor at and past president of Harvard University. He was treasury secretary from 1999 to 2001 and an economic adviser to President Obama from 2009 through 2010.

On June 23, Britain will vote on whether to remain in the European Union. On Nov. 8, the United States will vote on whether to elect Donald Trump as president. These elections have much in common. Both could yield outcomes that would have seemed inconceivable not long ago. Both pit angry populists and nationalists against the traditional establishment. And in both cases, polling indicates that the outcome is in doubt, with prediction markets suggesting a probability of between 1 in 4 and 1 in 3 of the radical outcome occurring.

It is interesting to contrast the ways that financial markets are reacting to the uncertainties associated with these two elections. The markets are highly sensitive to Brexit news: The pound and the British stock market move with every new poll. Analysis of option pricing and conversations with market participants suggest that if Britain votes to leave the union, the pound sterling could easily fall by more than 10 percent and the British stock market could fall by as much as 10 percent, with even greater declines for companies that conduct all of their business in Britain. It is widely believed that the uncertainties associated with Brexit are consequential enough to affect the policies of the Federal Reserve and other major central banks.

There are good reasons for markets to be on hair-trigger alert over Brexit. It would in all likelihood be economically very costly for Britain to leave the E.U. — causing increased uncertainty about the future of the British economy, making Britain a less attractive destination for businesses oriented toward the European economy, raising questions about the future cohesion of the United Kingdom, threatening London’s role as a financial center and curtailing British exports to Europe.

What is very surprising is that U.S. and global markets and financial policy makers seem much less sensitive to Trump risk. Options markets suggest only modestly elevated volatility in the period surrounding the presidential election. While every Fed watcher comments on the implications for the Fed of Brexit, almost none comment on the possible consequences of Trump.

As Britain's main opposition leader, Jeremy Corbyn, jumps into the Brexit debate, opinion polls hint at an evenly divided electorate. (Reuters)

Yet, as great as the risks of Brexit are to the British economy, I believe the risks to the U.S. and global economies of Trump’s election as president of the United States are far greater. Indeed, if he were elected, I would expect a protracted recession to begin within 18 months. The damage would in all likelihood be felt far beyond the United States. Here’s why.

First, there is a substantial risk of highly erratic policy. Trump has raised the possibility of more than $10 trillion in tax cuts, which would threaten U.S. fiscal stability. He has also raised the possibility of the United States restructuring its debt in the manner of a failed real estate developer. Perhaps this is just campaign rhetoric. But historical research suggests that, contrary to popular belief, presidents tend to carry out their major campaign promises. The shadowboxingover raising the debt limit in 2011 (where all participants recognized the danger of default) was central to the stock market falling by 17 percent. A president with an entirely reckless fiscal program and an openness to restructuring debt could damage confidence and markets in the short run and the creditworthiness of the country and centrality of the dollar over the longer term.

Second, in a world economy defined by global integration, Trump’s economic nationalism is highly dangerous. Exports have been a major driver of the U.S. economy in recent years. What would happen to them if we built a wall along our southern border and abrogated all our trade treaties? How would other countries react? The failure of the Trans-Pacific Partnership would be the least of the international economic problems brought about by a Trump presidency. Withdrawal from trade agreements does not currently require congressional approval. If Trump did even half of what he has promised, he would surely set off the worst trade war since the Depression.

Third, prosperity depends on a secure geopolitical environment. Requiring Japan and Korea to defend themselves and scaling back NATO is a prescription for both emboldening China and Russia and promoting nuclear proliferation as our allies seek to become self-sufficient. A perception that the United States is at war with Islam rather than with radical elements within Islam is an invitation to terrorism. In such an environment, it is hardly likely that investment and trade would flourish.

Fourth, Trump’s authoritarian style and cult of personality surely would take a toll on business confidence. He has proposed to bring back torture as a tool of U.S. foreign policy and to change the law so he can sue and punish publications he does not like. The country was paralyzed by the Watergate scandal and, to a lesser extent, Iran-Contra, both of which involved extralegal activity by the president’s staff and the abuse of government power. Who would rest secure with President Trump controlling the FBI, CIA and IRS?

Finally, there is the question of uncertainty and confidence. Improving business confidence is the cheapest form of stimulus. Creating an environment where every tradition of the rule of law, internationalism and consistency in policy is up for grabs would be the best way to damage a still-fragile U.S. economy. In no election in my lifetime has a major-party candidate for president been so dangerous for the economy. Markets now are discounting the possibility of a Trump presidency. Let us all pray they are right.