Stocks in the United Arab Emirates surged on Thursday, outperforming most major Gulf markets, boosted by strong earnings at top lenders.

In Abu Dhabi, the index closed 2.7% higher, buoyed by First Abu Dhabi Bank (FAB), which rose 4% to its highest level since May after posting a 5% rise in second-quarter net profit.

The bank recorded a net profit of 3.2 billion dirhams ($871 million) in the quarter ending June 30, versus 3.06 billion dirhams a year earlier.

Similarly, the Dubai index climbed 1.7%, driven by a 2.7% rise in Emirates NBD after the bank announced an 80% jump in second-quarter earnings.

The bank made a net profit of 4.74 billion dirhams ($1.29 billion) in the three months to June 30, helped by an asset sale and foreign exchange gains. EFG Hermes had expected a net profit of 4.06 billion dirhams. 

The results reinforced signs that top banks in the UAE are managing to withstand strains from a sluggish economy and a property downturn in Dubai.

Emirates NBD said on Wednesday it had received permission to open 20 more branches in Saudi Arabia. 

Egypt's blue-chip index advanced 0.2%, with Cairo Investment and Real Estate Development jumping 6.8%.

Saudi Arabia's main index fell 0.5%, ending eight straight days of gains triggered by EFG Hermes forecasting that profits for the kingdom's financial sector would grow 7.6% in the second quarter. Nine of 11 Saudi banks fell.

Al Rajhi Bank lost 0.7%, while National Commercial Bank was down 0.9%.

Qatar's index dropped over 1% with 17 of 20 stocks declining. Commercial Bank plunged 4.5% and Industries Qatar lost 1.5%.

($1 = 3.6728 UAE dirham)

(Reporting by Ateeq Shariff in Bengaluru; Editing by Kevin Liffey) ((AteeqUr.Shariff@thomsonreuters.com; +918067497129;))