* TSX up 12.99 points, or 0.12 percent, at 10,686.83
* Energy sector up 0.3 percent as oil price up 4 percent
* Investors bid up banks ahead of results next week (Updates with official closing numbers, details, quotes)
By Jennifer Kwan
TORONTO, Aug 19 (Reuters) - Toronto's main stock index ended slightly higher on Wednesday, helped by firmness in energy shares as oil prices jumped after a U.S. inventory report fueled hope that oil demand could be recovering.
Oil company Canadian Natural Resources CNQ.TO climbed 0.3 percent to C$63.64, and EnCana ECA.TO was up 0.6 percent at C$56.84.
The index fought back from a 1.5 percent slide earlier in the session, when market sentiment was undermined by a big selloff on Chinese stock markets that shook investor confidence about the strength of global economic recovery.
The choppiness of trade highlighted anxiety in the market, said Kate Warne, Canadian market strategist at Edward Jones in St. Louis, Missouri.
"There's still concerns about whether economic growth globally is going to resume at a fast enough pace to support the higher stock prices we've already seen," Warne said.
"Offsetting that is the fact that we're seeing higher oil prices and U.S. markets have rebounded a bit."
Data showed crude stocks in the United States fell last week, confounding analyst expectations for a rise and pushing oil up more than 4 percent on Wednesday to settle above $72 a barrel. [ID:nSIN507010] That helped lift the index's energy group by 0.3 percent.
The index's financial sector was up 0.5 percent ahead of quarterly results from Canada's big banks due next week. Royal Bank of Canada RY.TO was up 0.9 percent at C$50.58, and Toronto-Dominion Bank TD.TO rose 1.7 percent at C$63.58.
The S&P/TSX composite index .GSPTSE was up 12.99 points, or 0.12 percent, at 10,686.83, with six of the index's 10 main groups higher.
($1=$1.10 Canadian) (Reporting by Jennifer Kwan; editing by Peter Galloway)