UPDATE 1-China's BoCom H1 net profit up 3.5 pct, margins steady

* H1 net profit 39 bln yuan vs 37.7 bln yuan a year-ago

* Net interest margin end-June flat vs 1.57 pct end-March

* Non-performing loan ratio down slightly at end-June

* Sees net interest margin steadying or widening in H2 (Adds net interest margin, non-performing loans, other details)

SHANGHAI/BEIJING, Aug 24 (Reuters) - China's Bank of Communications Co Ltd , the country's fifth-largest listed bank by assets, reported a slight rise in net profit for the first half of 2017 as margins steadied, a filing with the Hong Kong stock exchange shows.

BoCom, the first to report six-month results among China's "Big Five" listed state-owned banks, on Thursday posted a net profit of 38.98 billion yuan ($5.85 billion) for the January-June period, up 3.5 percent from a year ago.

This implies a better-than-expected earnings of 19.65 billion yuan for the second quarter, up 5.7 percent year on year, Reuters calculations show. Four analysts on an average had forecast a profit of 19.1 billion yuan for the quarter.

The bank's non-performing loans stood at 1.51 percent at the end of June, versus 1.52 percent at end-March, while its net interest margin (NIM) showed signs of stabilisation after nine quarters of dips.

BoCom's NIM, or the difference between interest paid and earned - a key gauge of profitability for lenders, stayed flat at the end of June versus 1.57 percent at the end of March.

Margins are expected to stabilise or possibly widen in the second half of the year, BoCom said in an earnings briefing.

However, there are some concerns China's top lenders may face headwinds later this year from higher funding costs and slower loan growth amid a shadow banking crackdown.

Regulatory steps to reduce leverage and improve transparency has forced banks to shift shadow-lending activity onto their balance sheets, eating into their loan quotas. Analysts estimate that some banks have used up 80 percent of their yearly credit quota over January-June, versus the usual 60 percent.

This means lenders will have less money with which to make profits in the second half.

Moody's Investors Service recently changed its outlook for China's banking system to stable from negative in its first revision of the sector in two years.

The country's top four lenders, Industrial and Commercial Bank of China, China Construction Bank and Agricultural Bank of China and Bank of China Ltd , will report first-half results next week. ($1 = 6.6617 Chinese yuan renminbi) (Reporting by Engen Tham and Matthew Miller in Beijing; Editing by Himani Sarkar)