Spanish banks were crippled by a property market slump and a six-year economic downturn, hitting earnings through hefty writedowns and a drop-off in lending.

Many are still setting aside funds as a precaution against soured loans - with Sabadell's provisions to cover troubled assets rising 32 percent in the first half of 2014 compared with a year ago - and are also bumping up their capital levels ahead of Europe-wide health checks this year.

But income earned from loans, net of funding costs, has begun to improve since the end of 2013, as payouts on deposits come down, helping banks' margins.

Sabadell and Bankinter reported further gains in this area in the second quarter, setting the tone for the rest of the sector ahead of earnings next week from larger rivals Santander and BBVA.

Sabadell, Spain's fifth-biggest bank by stock market value, said on Thursday net interest income (NII) reached 546 million euros (430 million pound) in April to June, up 32 percent from a year ago and higher than in the first three months of the year.

Analysts polled by Reuters had forecast NII of 541 million euros.

At smaller Bankinter, NII also grew 18 percent from a year ago, to 185 million euros.

The two banks also said profits had improved in the second quarter, with Sabadell's rising 20 percent to 87 million euros and Bankinter's up 43 percent at 74 million euros.

Their bad loans as a percentage of total credit - a closely-watched measure of how defaults were hurting banks during the worst of the crisis - fell at the end of June compared with end-March.

Sabadell's ratio stood at 13.35 percent, just below a sector average, while Bankinter, which was not as exposed as peers to the ailing real estate sector, has a much lower level.

(Editing by Julien Toyer and David Holmes)

By Sarah White