MADRID, July 22 (Reuters) - Spain's Bankinter said on Thursday it booked a net profit of 992 million euros ($1.17 billion) in the second quarter mainly thanks to capital gains from the market listing of its insurance unit Linea Directa Aseguradora.

In the same quarter last year, Bankinter reported a loss of 21.2 million euros after booking 177 million euros in COVID-19 related provisions.

Analysts polled by Reuters expected a 997 million euro net profit.

($1 = 0.8480 euros) (Reporting by Jesús Aguado; editing by Inti Landauro)