TORONTO -- Canada's main stock index ended lower Friday after gaining ground earlier in the day, while U.S. markets had minor gains and the loonie was down slightly.

The S&P/TSX composite index closed down 6.30 points at 16,561.12 on subdued volumes to dip from the record close a day earlier.

The index ended the week up 1.16 per cent, and is up 2.2 per cent for the year after recovering from a major dip in February.

The energy sector was one of the few indexes on the TSX to end positive, helped along by a rise in oil prices.

The August crude contract closed up 68 cents at US$71.01 per barrel. The price was recovering after the Trump administration's tariff threats against China earlier this week overshadowed a report from the U.S. of strong stockpile draws.

"That was strong, but unfortunately it was masked by all the trade disruptions earlier in the week," said Ian Scott, an equity analyst at Manulife Asset Management.

In New York, the Dow Jones industrial average closed up 94.52 points at 25,019.41. The S&P 500 index closed up 3.02 points at 2,801.31 and the Nasdaq composite index was up 2.06 points at 7,825.98, a record close.

U.S. banks have started to report earnings but have slipped on missed expectations, said Scott.

"Bank stocks are under a bit of pressure as results weren't as good as people were hoping."

The Canadian dollar averaged 75.92 cents US, down 0.03 of a US cent.

The August crude contract closed up 68 cents at US$71.01 per barrel and the August natural gas contract was down five cents at US$2.75 per mmBTU.

The August gold contract ended down $5.40 at US$1,241.20 an ounce and the September copper contract was unchanged at US$2.78 a pound.

Callidus Capital Corp. closed down $1.51, or 28.60 per cent, at $3.77 after the eliminated its dividend. The company, which specializes in financing for companies that are unable to obtain loans from conventional lenders, said it needed the cash to fund loan growth.