* Has been without functioning government for 8 months (Adds comments from economy minister, analysts)

By Angus Berwick

MADRID, Aug 25 (Reuters) - Spain’s economy grew strongly in the second quarter as consumer spending stayed robust and demand for exports rose, though there were signs that a vibrant investment climate may be starting to cool after months of political uncertainty.

An economic recovery has retained momentum through eight months without a functioning government, as the country has continued to notch up one of the fastest growth rates in the euro zone this year.

Quarter on quarter GDP growth reached 0.8 percent, keeping pace with the first quarter and up a tenth of a percentage point from a preliminary estimate, Thursday’s final data from national statistics agency INE showed.

Consumer spending grew 3.6 percent year on year as people who kept their jobs through a recession that ended in 2013 took advantage of better times to buy big-ticket goods like washing machines.

Exports of services also performed well, INE said, even outside the tourism sector which has been boosted by record numbers of visitors this summer.

Spain’s acting economy minister, Luis de Guindos, said he expected the economy would eventually be impacted by the lack of a government.

However “from what we can tell there is no slowdown in the third quarter, it will be similar to the second and first,” he told reporters.

After two inconclusive national elections in December and June, the spectre of a third looms.

Politicians last week inched closer to ending the impasse when the People’s Party of acting Prime Minister Mariano Rajoy agreed terms to negotiate a pact with a smaller rival, Ciudadanos.

If the agreement is sealed, Ciudadanos will back Rajoy in a parliamentary confidence vote on Aug. 31 on forming a government. But even then Rajoy would still be short of the majority he needs, raising the possibility of third ballot in December unless others also agree to back him or abstain.

CHALLENGING AUTUMN

While fallout for gross domestic product so far has been slight, the political deadlock has triggered concerns that companies might delay expansion plans.

A slowdown in manufacturers’ investment in equipment and machinery extended into the second quarter, the INE data showed, when it grew at 7.8 percent year-on-year against 9.3 percent in the previous three months and almost 11 percent in the last quarter of 2015.

Analysts from Barclays said they expected investment growth to continue to decelerate, hit by declining business confidence. However, they raised their 2016 growth forecast by 0.3 percentage points to 3.1 percent, citing strong exports.

In a sign of the possible impact on government investment, spending on public works contracts slumped by a fifth in the first quarter, separate data showed on Tuesday, as decisions on infrastructure projects like roads, ports and trains were deferred.

On an annual basis the economy grew by 3.2 percent in the second quarter, INE said - below the 3.4 percent growth rate of the first but in line with a preliminary estimate.

The acting government expects the economy to expand 2.9 percent this year - one of the fastest rates in the euro zone - though scrutiny is growing over whether that will be enough to reach deficit targets without spending cuts.

Gross debt rose to a record high 1.1 trillion euros ($1.24 trillion) in June, Bank of Spain data showed on Wednesday, which the economy ministry said was equivalent to 100.9 percent of national output - well above 2016 goals.

Further delays to forming a government would bring Spain up against the EU’s deadline of mid-October to submit a 2017 budget. Missing that would damage investor confidence and raise the possibility of sanctions.

“Spain is heading towards a challenging autumn as a late government formation would mean delays to the budget, the expenditure ceiling and the new path of deficit target approval,” the Barclays analysts said in a note. (Additional reporting by Carlos Ruano; Editing by John Stonestreet)