The buyer is Bankia, a Spanish bank that was formed in December 2010 by consolidating seven regional savings banks. It was partially nationalised by the Spanish government in May 2012 following its near collapse.
The deal netted Aviva €203m (£179m, $238m).
In the statement, Aviva said it has also agreed to sell its 50% shareholding in Spanish life insurance operation Pelayo Vida to insurance and reinsurance company Santalucía.
“The transaction is subject to regulatory and anti-trust approvals and is expected to be completed in the fourth quarter of 2018.
“This transaction completes Aviva’s withdrawal from the [Spanish] market,” the company said.