Hong Kong shares rose for a fourth-straight session on Thursday, boosted by mainland issues as fears of a hard landing for the Chinese economy further dissipated after euro zone leaders struck a deal to resolve the region's debt crisis.

The Hang Seng Index closed up 3.26 percent at 19,688.7. The China Enterprises Index of top Hong Kong-listed mainland companies finished up 5.13 percent at 10,565.76.

The Shanghai Composite Index ended up 0.34 percent at 2,435.61 as investors took profit on materials names that outperformed this week, limiting third-quarter earnings-driven gains in financials.

HIGHLIGHTS:

* Thursday's gains helped the Hang Seng Index recover almost all losses from the selloff in September. Near-term resistance is seen at about 19,803, which supported the benchmark over three sessions in mid-September. It is the top end of a bigger gap that formed between Sept. 9 and 12, which heralded the start of the selloff.

* Mainland stocks - particularly financials, property, resources and infrastructure counters, which suffered the brunt of the selloff last quarter - surged, registering gains in strong volume. While turnover on the Hong Kong bourse was the highest in more than a month, it was not at levels seen in August, the first of two selloffs last quarter on fears of a tanking Chinese economy. Analysts suggested that many investors were still on the sidelines, suggesting this counter-trend rally could still have some legs left.

* Railway-related stocks outperformed, extending their recent recovery, with China Railway Group Ltd surging 17.5 percent and China Railway Construction Corp Ltd up 12.2 percent in volume almost five times its 30-day average. The sector has been steadily regaining its footing since mid-October after a series of policy measures aimed at injecting liquidity and reactivating investment in an industry dogged by accidents and even a sagging property sector, whose fortunes are key to the continued expansion of rail lines. - Reuters