The Canadian dollar weakened against its U.S. counterpart on Thursday, pulling back from a one-week high as the greenback recovered some lost ground against a basket of major currencies.

The loonie had rallied this week as investor fears of a more unfavorable trade outlook for Canada abated and after U.S. President Donald Trump signed orders on Tuesday smoothing the path for the Keystone XL oil pipeline, but nervousness remains.

"For the moment the Mexican peso is taking the brunt of it, but there are still some spillover effects for the loonie," said Alphonso Esparza, senior market analyst at OANDA Corp.

"It's a tweet-by-tweet anxiety, that the eye of Trump could settle on the loonie."

If constructed, Keystone would provide oil producers in Canada with a quicker route to send crude to U.S. Gulf Coast refiners. But analysts and traders said the $8 billion pipeline was far from being a certainty. 

The White House said on Thursday that Trump wants a new 20 per cent tax on imports from Mexico to pay for a wall on the southern border, deepening a crisis after a planned summit between the two countries' leaders fell through. 

Trump has said he will open a renegotiation of the NAFTA trade pact between the United States, Canada and Mexico at an "appropriate time".

The U.S. dollar rebounded after its worst run since August as investors refocused on the chances of higher U.S. inflation and growth. 

The Canadian dollar settled at $1.3098 to the greenback, or 76.35 cents US, weaker than Wednesday's close of $1.3067, or US$76.53.

The currency's weakest level was $1.3130, while it touched its strongest since Jan. 18 at $1.3054.

The slip for the Canadian dollar came even as prices of oil, one of Canada's major exports, rose. U.S. crude prices settled up nearly two per cent at US$53.78 a barrel.

Canadian government bond prices were mixed across the yield curve, with the two-year up half a Canadian cent to yield 0.815 per cent and the 10-year rising three cents to yield 1.819 per cent while the 20-year price fell $1.31 to yield 2.438 per cent.

The 10-year yield touched its highest since Dec. 16 at 1.851 per cent as Wednesday's record highs on Wall Street reduced demand for safe-haven assets such as bonds.