* German state posts budget surplus of 23.7 bln euros
* Has also been spending to integrate, house refugees
* Government sees consumption-led upswing continuing
* GDP growth quadruples to 0.4 pct in fourth quarter (Adds picture tag)
By Michael Nienaber
BERLIN, Feb 23 (Reuters) - Germany posted a record budget surplus last year helped by rising tax revenues and employment and low debt costs, creating conditions for solid economic growth in 2017 underpinned by higher state and household spending.
The German state has been running a surplus for three years, with the gap rising to 23.7 billion euros ($25 billion) in 2016, the highest since the country reunified in 1990, Federal Statistics Office data showed on Thursday.
That has created a huge fiscal buffer at a time when authorities are working to house and integrate hundreds of thousands of immigrants, and separate Statistics Office data showed higher state spending was a factor in boosting economic growth to 1.9 percent last year.
Under Germany's budget law, the federal government's surplus of 7.7 billion euros will go into a fund for refugee-related expenditure.
The economic growth rate for 2016 was the strongest in half a decade, and the Finance Ministry said it expected spending by households and public authorities to drive gross domestic product growth again this year - consolidating a shift away from the export activity that traditionally powered Europe's biggest economy.
As well as supporting economic growth, the arrival of more than a million migrants - most fleeing war and poverty in Africa and the Middle East - in Germany last year has polarised the country's political landscape ahead of federal elections due in September.
Thursday's Statistics Office data, which confirmed preliminary GDP readings, also pegged fourth quarter growth at 0.4 percent, showing foreign trade as a net negative.
The government expects growth to slow to a still robust 1.4 percent in 2017.
"The German economy is on a solid growth path," the finance ministry said in its monthly report, also released on Thursday, adding that indicators signaled a continuation of the economic upswing in 2017.
"Consumption will probably remain an important driver of economic growth," the ministry said, pointing to job creation, pay hikes, low interest rates and moderate, albeit rising energy prices.
The ministry's report supported readings in Wednesday's Ifo index, which showed German business morale rose in February, boosting hopes for a robust start to 2017 despite worries about U.S. trade policies and the outcome of elections in France due in April and May.
Germany's economic upturn is also pushing up tax income.
In January, revenues of the federal government and the 16 regional states rose 4.0 percent on the year, the finance ministry said. That is proportionally above the projected rise of 2.9 percent for the whole year.
The buoyant tax revenue has enabled Chancellor Angela Merkel's government to raise state spending on roads, faster internet and refugees without taking on new debt.
It also means Finance Minister Wolfgang Schaeuble can stick to his cherished but internationally criticised goal of running a balanced budget as the government gears up for what promises to be a tightly contested election.
But a continuation of Germany's consumption-led upswing is by no means guaranteed.
Suggesting it might weaken, a survey showed on Thursday that the mood among German consumers worsened more than expected heading into March to reach its lowest level in four months.
The survey by the Nuremberg-based GfK institute cited rising inflation and economic risks linked to the policies of U.S. President Donald Trump as the main factors for the dip.
Its consumer sentiment indicator, based on a survey of around 2,000 Germans, fell to 10.0 going into March. A Reuters poll had expected a fall to 10.1 from 10.2 a month earlier.
$1 = 0.9477 euros Reporting by Michael Nienaber, editing by John Stonestreet