OTTAWA—Canadian Prime Minister Justin Trudeau said Friday he would consider retaliatory measures in response to the U.S. imposing a 20% tariff on lumber imports from its northern neighbor.

Mr. Trudeau said in a letter to the premier of British Columbia that he would “seriously and carefully” review the province’s request to respond to the U.S. tariff. The bulk of Canada’s softwood lumber, used in the construction of homes, originates in British Columbia.

The Pacific Coast province wants the federal government to ban the shipment of U.S. thermal coal bound for customers in Asia. Ports in Canada fall under federal authority.

U.S. producers have shipped thermal coal, used by power plants to produce electricity, to British Columbia export terminals due to a lack of U.S. capacity in U.S. ports. The British Columbia government estimates that last year the Port of Vancouver handled 6.2 million metric tons of U.S. thermal coal.

British Columbia Premier Christy Clark is in the final stages of a re-election campaign, and her right-leaning Liberal Party is in a tight race with her left-leaning opponent, polling indicates. The prime minister’s letter comes four days before residents in Canada’s third-largest province head to the polls.