Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

After repeated campaign promises to "get tough on trade," President Donald Trump has moved to slap a roughly 20 percent tariff on softwood lumber entering the United States from Canada, reviving a long-smoldering trade dispute between the U.S. and its second-largest trading partner.

"People don't realize Canada has been really rough with the United States," Trump said before signing an executive order on an agriculture task force on Tuesday." They've outsmarted our politicians for years."

"We don't want to be taken advantage of by other countries and that's stopping and that's stopping fast," he said.

The move also follows complaints from U.S. dairy farmers about a recent decision by Canada to change the way tariffs apply to some milk products. The action has had the effect of cutting prices Canadian buyers pay for dairy imports from the U.S.

Trump has called the move "a disgrace" that's hurting U.S. producers in dairy states like Wisconsin.

"It has been a bad week for U.S.-Canada trade relations," said Commerce Secretary Wilbur Ross in a statement. "This is not our idea of a properly functioning free trade agreement."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Canadian officials rejected the White House's assertions that its lumber industry is unfairly subsidized and urged the Trump administration to negotiate a settlement.

"You need our lumber to build your homes," Canada's minister of foreign affairs, Chrystia Freeland, told CNBC on Tuesday, noting that lumber prices have been rising. "If the market was being flooded by cheap Canadian lumber, you wouldn't see that happening right now."

President Donald Trump and Canadian Prime Minister Justin Trudeau walks off at the conclusion of a joint news conference in the East Room of the White House in Washington on Feb. 13, 2017. Pablo Martinez Monsivais / AP

The U.S. runs a trade deficit in lumber with Canada, importing more wood than it sends across the northern border. U.S. producers complain that their Canadian competitors enjoy an unfair advantage by harvesting timber more cheaply on federally owned land, while American timber is largely grown on private land.

Related: Justin Trudeau Warns Trump About NAFTA Plan, Says Deal Is Good for U.S. Jobs

The trade dispute between lumber producers in Canada and the U.S. dates back to the Reagan administration, when a tariff on wooden shakes and shingles sparked a retaliation from Ottawa in the form of higher duties on a variety of U.S. products, including books, computers, semiconductors and even Christmas trees.

That trade skirmish helped promote the idea of a broader North American Free Trade Agreement, which was signed by President George H.W. Bush in 1992 and took effect in 1994. Trump has branded NAFTA "a disaster" for American workers, vowing to renegotiate the three-way trade treaty between the U.S., Canada and Mexico.

The dispute over dairy products stems from a new pricing agreement with Canadian farmers that slashed the price of the milk ingredients used to make cheese and yogurt. U.S. dairy farmers say the new accord has cost Wisconsin and New York companies millions of dollars.

Wisconsin is the largest dairy producer in the U.S. and runs the biggest trade surplus in dairy products with Canada.

Trump and Canadian Prime Minister Justin Trudeau spoke by phone Tuesday and the two leaders "discussed the dairy trade in Wisconsin, New York state, and various other places" and "also discussed lumber coming into the United States," the White House said.

"It was a very amicable call," the White House said in a statement.

While this week's trade skirmish covers a relatively small piece of overall U.S. trade, a wider dispute could create headwinds for the economy and raise prices for American consumers.

The impact would be felt unevenly from one part of the country to another, with states along the northern border most heavily affected.