* Economy grows 0.2% Q/Q in Q1
* Boosted by construction, machinery investments
* Analysts say no strong upswing in sight (Adds background, analysts)
BERLIN, May 25 (Reuters) - The German economy grew slightly in the first quarter from the previous one, data showed, with higher investments offset by the twin impacts of war in Ukraine and COVID-19 that experts predicted would weigh more heavily in the three months to June.
Europe's largest economy grew an adjusted 0.2% quarter on quarter and 3.8% on the year, the Federal Statistics Office said on Wednesday. A Reuters poll had forecast 0.2% and 3.7%, respectively.
The reading meant that Germany skirted a recession, often defined as two quarters in a row of quarter-on-quarter contraction, after gross domestic product (GDP) fell by 0.3% at the end of 2021.
While household and government spending remained mostly at the same level as in the previous quarter and exports were down at the start of the year, investments grew.
Construction investments, boosted by mild weather, were up 4.6% from the previous quarter, despite price increases, and machinery and equipment investments rose 2.5%.
German business morale rose unexpectedly in May as its economy showed resilience, according to an Ifo institute survey published this week that found no observable signs of a recession.
However, there is no upswing in sight either, and Sebastian Dullien, director of the Macroeconomic Policy Institute (IMK), predicted the effect of the war and pandemic-linked restrictions in China - Germany's biggest trading partner last year, according to official data - would be much greater in the second quarter.
ING economist Carsten Brzeski said he was sticking with his baseline scenario of a slight GDP contraction in the second quarter after Wednesday's reading.
"The build-up of inventories and weak consumption in the first quarter, as well as very weak consumer confidence, clearly dampen the optimism that traditional leading indicators are currently conveying," he said.
A consumer sentiment index by the GfK institute inched up slightly heading into June from an all-time low in May, with household spending burdened by inflation.
The government forecasts economic growth of 2.2% in 2022. (Reporting by Miranda Murray and Rene Wagner; Editing by Paul Carrel and John Stonestreet)