Foreign cash jolts Spanish home building back to life

* Demand rising for middle class homes to top-end apartments

* Foreign investors driving market more than locals

* Spanish cities cheap compared with London or Paris

* Properties offer 6 pct yields in era of ultra low rates

By Sonya Dowsett

MADRID, July 20 (Reuters) - Residential construction is coming back to life in Spain eight years after a property crash, with foreign investment pouring into developments in Madrid and Barcelona, and a jump in building permits pointing to more growth to come.

Half a million newly-built homes remain empty after the mania that peaked in 2007, largely on urban fringes and in remoter areas where people don't want to live.

But demand for properties ranging from luxury apartments to homes for the middle classes is rebounding in leading cities and industrially-strong regions such as the Basque Country, showing how Spain's economic recovery is on course despite political paralysis after two inconclusive general elections.

Construction and real estate accounted for more than a third of the nearly 22 billion euros ($24 billion) of foreign investment in Spain in 2015, Economy Ministry data shows.

While overall activity remains a small fraction of peak levels, funds spent on residential construction last year were more than 80 times greater than in 2014.

"The market has fired up precisely because players have come from overseas," said Ernesto Tarazona, partner at property consultancy Knight Frank. "There are some local investors left, but not many."

Foreign funds desperate for a return on their investments at a time of ultra-low interest rates have flocked to Spain as the 2008 crisis has knocked around 40 percent off property prices.

According to real estate portal Idealista, rental yields increased to 6.1 percent in the second quarter, five times the return on a 10-year government bond.

Spain still has no new government, seven months and two elections after Prime Minister Mariano Rajoy lost his parliamentary majority, with leading parties so far failing to agree on a coalition.

But this doesn't seem to be discouraging property investors. Madrid ranked fourth in a 2016 league of European cities which PWC compiles, based on a survey of investors' and developers' views on which property markets offer the best prospects.

The Spanish capital ranked ninth globally in an EY survey which asked real estate executives where they plan to invest in the next few months.

Investments vary widely - from buying blocks of rented apartments to packets of mortgage debt and banks' property management units.

Private equity funds have become the country's new developers, looking to make profit on residential building given Spain's fourth year of economic recovery and a lack of suitable property in areas that are in demand. Property consultant CBRE predicts annual demand of 180,000 units over the next 10 years.