* H&M among top gainers on STOXX after profits beat forecasts
* Retail outperforms all European sectors at quarter's end
* UK PM May's Brexit deal defeated for the third time (Updates to close)
March 29 (Reuters) - European shares rose on Friday but settled slightly below session highs after lawmakers rejected UK Prime Minister Theresa May's deal to exit the European Union for the third time, increasing the possibility of a 'no deal' or prolonged Brexit.
The pan-European STOXX 600 index closed up 0.6 percent, having earlier hit session highs on encouraging signals from U.S.-China trade talks.
The benchmark clocked its best quarter in four years, although gains in March were lower than in the previous two months as a bruising trade war which contributed to a slowdown in global growth and the chaos around Brexit hit sentiment.
All sub-sectors within the pan-regional benchmark ended the quarter higher, led by the retail sector's 20 percent surge over the last three months.
France's CAC 40 outperformed with a 1 percent gain on the day, while Germany's trade-sensitive Dax rose 0.9 percent and Britain's exporter-heavy FTSE 100 was up 0.6 percent.
Stocks in Dublin - a barometer for Brexit sentiment - closed 1.5 percent higher, posting their best day in almost two months.
Britain now has until April 12 to convince the other 27 EU capitals that it has an alternative path out of the impasse or see itself cast out of the bloc with no deal on post-Brexit ties with its largest trading ally.
Many eurosceptics prefer the 'no deal' option, but businesses say it would cause huge damage not only to the world's fifth-biggest economy, but also to that of neighbouring Ireland.
Swedish-based apparel retailer H&M was among the top gainers on the STOXX 600, up 9.5 percent after reporting a smaller-than-expected drop in quarterly pre-tax profit.
The European labour market is robust, and gains in personal income are boosting retail sales, said Bert Colijn, an economist at ING.
Europe's retail sector logged its best quarter since the second quarter of 2003 and while banks posted the second smallest sectoral gain, they broke a five quarter losing run.
Stocks also got a boost from reports that U.S. Treasury Secretary Steven Mnuchin had a productive working dinner in Beijing as U.S.-China trade talks ended.
Any move towards a deal would be positive for European markets, Colijn said, as the slowdown in China and the U.S. has had an impact on exports from Europe.
Shares in Galapagos surged 22 percent after the Belgian drugmaker said it had seen positive results from several trials of a rheumatoid arthritis drug.
Business software firm SAP and oil and gas major BP PLC were also among the biggest gainers.
Nordea Bank shed more than 10 percent, while Swedbank dropped 7.6 percent. Both stocks went ex-dividend on Friday, while New York's financial regulator has reportedly has sent letters to both as part of a money-laundering investigation.
Reporting by Medha Singh, Agamoni Ghosh and Susan Mathew in Bengaluru; editing by Larry King and Kirsten Donovan