Growth in traditionally export-oriented Germany was supported by rising spending at home by consumers and by the government, the agency said.
Europe's largest economy's GDP grew by 1.5 per cent last year, compared with 2.2 per cent the previous year, according to data from the country's Federal Statistics Office.
The growth figure announced Thursday by the government statistics agency was down from 2.2 percent in 2017.
Dodging two consecutive quarters of shrinkage - the official definition of a recession - means "it now looks as if the German economy could get away with one black eye", ING Diba bank economist Carsten Brzeski commented.
Meanwhile a long drought brought low water levels in the Rhine that hampered shipments of chemicals and raw materials.
Figures released last week also showed German industrial production declined 1.9 percent month-on-month in November, which was significantly below a consensus for growth of 0.3 percent.
It said domestic demand was the main driver of growth, while household consumption was also up one per cent on the previous year.
Data also showed that the general government surplus was Euro 59.2 billion in 2018versus Euro 34.0 billion in 2017.
The European Central Bank has indicated that if the economy worsens it could postpone a first interest rate increase beyond the earliest possible date in the fall of 2019.
Among the loudest critics is US President Donald Trump, who regularly rails against Germany's "unfair" trade imbalance and chastises Berlin for not spending enough on defence.
Altmaier has mooted public investments in electric auto battery production and European projects on artificial intelligence.
The growth rate was the weakest in three years after a 1.5 percent expansion in 2015.