Germany's economy witnessed lackluster growth in 2018, according to flash data released Tuesday, in line with expectations.

German gross domestic product (GDP) grew 1.5 percent in 2018, compared with 2.2 percent in 2017, the latest data from the Federal Statistics Office (Destatis) showed. The figures point to the weakest rate of growth in five years.

Destatis noted that the German economy had grown for the ninth year in a row, "although growth has lost momentum."

"In the previous two years, the price adjusted GDP had increased by 2.2 percent each. A longer-term view shows that German economic growth in 2018 exceeded the average growth rate of the last ten years (+1.2 percent)."

The data body also said positive contributions to growth came mainly from domestic demand in 2018.

"Both household final consumption expenditure (+1.0 percent) and government final consumption expenditure (+1.1 percent) were up on the previous year. However, the growth rates were markedly lower than in the preceding three years," it said.

German exports continued to increase on an annual average in 2018 (up 3.5 percent on the previous year), though at a slower pace than in the previous years.

An official estimate of fourth-quarter growth will only be available in February but the statistics office said it was likely that the economy had grown slightly in the period, meaning that a technical recession could have been avoided.