(Adds details and background)

RABAT, Oct 27 (Reuters) - Morocco's Attijariwafa Bank said it will sell 50 percent of OGM Holding, the parent company of Morocco's biggest insurance company Wafa Assurance, to the royal holding firm National Investment Co. (SNI) ahead of buying Barclays Egypt.

Attijariwafa said it is looking to solidify its solvency ratios in order to get regulatory approval for buying Barclays Egypt.

The bank is planning to fund its purchase of Barclays' Egypt, which it expects to close by the end of the year, through local financing deals, its managing director told Reuters earlier this month.

It is looking at capital increases, dividend management and a reorganisation of its shareholdings to finance the Barclays deal and will use Morocco's foreign reserves, with no plans for international bonds or bilateral foreign deals.

SNI will buy the stake at 3,250 dirhams per share, against a closing price of 3,670 dirhams on Thursday, valuing Wafa Assurance at about 11.4 billion dirhams ($1.15 billion).

OGM controls 79.29 percent of Wafa Assurance.

SNI has a 47.83 percent stake in Attijariwafa Bank, while Wafa Assurance holds a minority stake of 6.61 percent.

SNI, controlled by the Moroccan royal family, is the largest private stakeholder in the North African kingdom's economy.

Attijariwafa said OGM's sale will boost its core equity tier 1 (CET 1) ratio by about 1.66 percent.

Barclays has completed the sale of its Egyptian business to Attijariwafa Bank as part of its shift towards focusing on the United States and Britain. The sale will mean a cut of about 2 billion pounds ($2.55 billion) in Barclays' risk-weighted assets.

Barclays and Attijariwafa did not give a price for the transaction, although sources previously told Reuters they valued the business at around $400 million.

Barclays Egypt will represent 5 percent of Atiijariwafa's assets, and will add 13 percent to the bank's profit attributable to shareholders.

The Moroccan bank reported last month a 7.9 percent rise in its 2016 first-half net profit to 2.49 billion dirhams ($260 million).

($1 = 9.8897 Moroccan dirham)

(Reporting By Aziz El Yaakoubi; Editing by Alexandra Hudson) ((aziz.elyaakoubi@thomsonreuters.com; +212623934595)(;))