The annals of U.S. trade relations with Canada, our largest trading partner, include a recurring dispute over softwood lumber: the kind of pine boards used mainly in construction and home improvement, as well as for paper. And a new dispute is looming at a very awkward time for the United States.

Canada has vast forested acreage, most of it provincially managed “crown” land rather than private. With a small population relative to that of the United States, and a high degree of urbanization, there is less development pressure to clear land for farming, residential or other commercial use. Each year, provincial forest managers determine how much of the forest to make available for logging, and with what conditions (such as replanting and other environmental remediation).

In contrast, most U.S. forestland available to logging is privately held, and rights to log typically are obtained by auction. And there is less of it. State and federal governments still require replanting and environmental remediation. So, it is more costly to produce softwood in the United States than in Canada.

This is where population size matters: Canada can produce more softwood lumber than it could possibly use, and so its forestry sector is geared for export. The United States is Canada’s primary export market, and U.S. demand exceeds domestic production.

The Canada-U.S. Free Trade Agreement (CUFTA) in 1989 gave U.S. investors better access to the Canadian market, and the result was that U.S. firms moved into the Canadian market, sometimes by acquiring Canadian firms. The largest takeover saw U.S. firm Weyerhauser purchase MacMillan Bloedel in 1999.

A study last year by Daisuke Sasatani and Ivan Eastin at the University of Washington found that in the forest sector, larger U.S. firms and Canadian firms of all sizes oriented production for export markets, while firms based in the Southern U.S. were less able to export without a product differentiation strategy that would allow them to claim a price premium in export markets. In other words, softwood from the Southern U.S. was too high-cost to compete as a fungible commodity in global markets, and needed some processing to claim a higher price in world markets that would allow these firms to recoup costs.

Yet some of these U.S. firms have chosen a different option: seeking federal government protection from Canadian imports in order to compete for a larger share of the U.S. domestic market.

Economist Mike Moffatt at the Ivey School of Business at the University of Western Ontario gives a useful quick history of such trade disputes, starting in 1982 with a dispute that was settled by the Reagan administration in order to clear the air for the negotiation of the CUFTA.

While CUFTA, and later NAFTA and the World Trade Organization (WTO) provided dispute settlement mechanisms to handle future trade disputes over softwood, ultimately Ottawa and Washington negotiated political settlements directly that provided greater market stability and an end to trade disputes more effectively than these mechanisms, including a memorandum of understanding which governed softwood trade from 1986 to 1991, a 1996 Softwood Lumber Agreement negotiated by the Bill Clinton administration that lasted until 2001, and a 2006 Softwood Lumber Agreement negotiated by the George W. Bush administration that was set to expire in 2013 but was extended to Oct. 12, 2015 by the Obama administration.

The provisions of the 2006 agreement provided for a 12-month standstill for U.S. industry petitions for countervailing duties after the expiration of the agreement, a moratorium that expires on Oct. 1, 2016. At that point, one month before the U.S. election, the United States could launch a trade war with Canada over softwood that will damage the Canadian economy (already coping with weak commodity prices and slower growth and higher unemployment this year that in the United States).

This looming trade dispute has echoes of another conflict with Canada over U.S. country-of-origin labeling (COOL) requirements for pork and beef products. A small number of U.S. ranchers lobbied for these requirements as protection against Canadian and other imports, and Congress responded by calling for such labeling in the Farm Security and Rural Investment Act of 2002; the 2002 Supplemental Appropriations Act; and the Food, Conservation and Energy Act of 2008. A majority of U.S. producers complained about the costly new rule, and Canada took the dispute to the WTO and won a favorable judgment, and Congress repealed the requirement with an amendment in the 2016 Consolidated Appropriations Act earlier this year.

U.S.-Canadian relations will start off badly with the 45th president of the United States and the 115th Congress if a softwood dispute triggered by a minority set of firms in the U.S. lumber industry is triggered by new duties imposed on Canadian imports in October. Even in the best-case scenario, it will take months for the next administration to get itself organized to negotiate a new agreement with Canada, or for the Congress to act.

The right for firms to petition for protection is an important part of U.S. trade policy, but as the softwood lumber disputes with Canada have demonstrated repeatedly, such petitions have broader economic consequences and ultimately require a political resolution. U.S. trade diplomacy needs to head off disputes like this before they do damage to the broader economy — and relations with our best foreign customer, Canada.

Sands is a senior research professor and director of the Center for Canadian Studies at the Johns Hopkins University School of Advanced International Studies (SAIS) and the G. Robert Ross Distinguished Visiting Professor in the College of Business and Economics at Western Washington University. He is also a non-resident senior associate of the Center for Strategic and International Studies.