* Shanghai Composite Index set to close up 50 pct in 2014
* Best annual performance by major stock market this year
* Welcome respite from otherwise grim economic data
* Hong Kong shares close up 1.3 pct for year
By Pete Sweeney
SHANGHAI, Dec 31 (Reuters) - China stocks climbed to near 5-year highs on the last trading day of the year, as mainland markets look to end the year up more than 50 percent - the best annual performance by a major global stock market in 2014 after years spent in the basement.
"This year was a bit unexpected," said Tian Weidong, chief director of research department at Kaiyuan Securities in Xi'an.
"I think it took most people by surprise as they didn't realise this sort of market was possible."
The CSI300 index stood at 3,476.15 points at the end of the morning session on Wednesday, while the Shanghai Composite Index gained 0.7 percent, to 3,187.39 points, both near 5-year highs.
The rise is a major accomplishment for Beijing, as it has successfully convinced many Chinese investors to stop speculating on real estate and diversify into shares in Chinese companies.
And it offers a welcome distraction from an otherwise grim economic performance.
China looks set to post its slowest economic growth rate in decades, but the leadership can console themselves that its stock market, at least, was a world-beater, posting more than five times the annual rise of the Dow Jones Industrial Average .
But the rally's sustainability is in question, given that it has been almost entirely inspired by policy changes. The market was bolstered by optimism over monetary easing and rallied strongly after interest rates were cut in late November.
Mainland analysts are calling for another bull year in 2015, but that must be balanced against predictions that the Chinese economy is predicted to slow further, damaging earnings at some of the very blue chip banks that have led the rally.
In fact, a Reuters poll of Chinese fund managers showed them reducing their equity allocation in the next three months.
The Hang Seng index added 0.4 percent, to close at 23,605.04 points in a shortened trading day, up 1.3 for the year, the widest performance disconnect versus mainland markets since 2007.
The contradiction is highlighted in the index measuring price differences between dual-listed companies in Shanghai and Hong Kong, which stood at 127.76, indicating Shanghai shares are pricing at a major premium.
That difference was supposed to be erased by the launch of the Shanghai-Hong Kong Stock Connect, but the connector has seen extremely weak take-up by both foreign and Chinese investors.
Editing by Jacqueline Wong