UPDATE 1-Defensive sell-off pushes UK blue chips off 3-week high, ends lower

* FTSE 100 ekes out 2.3 pct gain on the week

* Burberry, StanChart boosted by hopes of end to U.S.-China row

* JPM China fund up 10 percent

* Midcaps hit 3-week high (Adds details, updates prices)

LONDON, Nov 2 (Reuters) - A sell-off in defensive sectors from tobacco to healthcare knocked UK shares off a three-week high and into negative territory at the close on Friday as earlier optimism over a Brexit deal and a possible end to the U.S.-China row faded.

The FTSE 100 ended the day down 0.3 percent, handing back gains that saw it shoot to its highest since Oct. 10 in the morning, as a disappointing outlook from Apple dragged Wall Street lower at the open.

It was up 2.3 percent on the week, clawing back some of the ground lost in October, its worst month in nearly two years as concerns about Brexit, Italy's budget, rising U.S. interest rates and slowing corporate earnings growth spooked investors.

On Friday defensive stocks, which held up relatively robustly compared with cyclicals and growth sector during the October sell-off, were out of favour, providing the most pressure on the blue chip index.

"Given the surge over the past week in equities, and the looming weekend, traders were always likely to be hunting for a reason to cut back on exposure at the end of the week, and so it has proved," said Chris Beauchamp, chief market analyst at IG.

"The drop has put a dent, but not a fatal one, into the current move higher."

Imperial Brands lost 2.8 percent, British American Tobacco sank 2.3 percent and GlaxoSmithKline fell 2.2 percent for its worst day in months.

Most macro focus remained on hopes of a Brexit deal and signals from the Bank of England that if the exit from the European Union is smooth, more interest rate hikes could be on the way. Investors were also cautious ahead of the U.S. Midterm elections on Tuesday.

But a Bloomberg report that U.S. President Donald Trump wants to reach an agreement with his Chinese counterpart Xi Jinping at the G20 summit in Argentina later this month drew most attention on Friday.

Burberry and other European luxury goods companies, which have been hurt by worries about weaker spending by China's burgeoning middle class, rallied on hopes of a breakthrough. Burberry was up 2.6 percent.

Standard Chartered benefited from the hopes of a China deal after warning earlier in the week about the impact of the dispute on its Asian business. It was up 4 percent.

JPMorgan Chinese Investment Trust was one of the biggest gainers on the small caps with a 9-percent rally for its best day in nearly 20 years. In late October, the shares hit their lowest since May last year.

Boardroom news drew focus elsewhere on the FTSE 100. Sage Group rallied 3 percent as investors welcomed news the software company's finance chief Steve Hare will take over as chief executive.

"It removes some of the uncertainty" following the resignation of predecessor Stephen Kelly in August, said Michael Hewson, market analyst at CMC UK.

The midcap FTSE 250 was up 0.8 percent at a three-week high buoyed by gains in cyclicals. Thomas Cook topped the gainers, rising 9 percent on lower oil prices.

Indivior rallied 7 percent after Jefferies raised its price target on the specialty pharma stock following its results on Thursday. Senior fell 7 percent. Barclays cut its target price on the stock. (Reporting by Josephine Mason Editing by Andrew Roche and Raissa Kasolowsky)