Turkey has entered a recession, recording two consecutive quarters of falling economic growth, according to government figures released Monday, casting a blow for President Recep Tayyip Erdogan ahead of critical local elections at the end of the month.

Mr. Erdogan has led Turkey through 18 years of continuous growth — making it a leading emerging market — but much of the growth of the last few years has come through unrestrained borrowing. The lira also plunged in value in mid-2018, amid global investor concerns and a sharp fall in consumer demand.

The Turkish Statistical Institute announced that Turkey’s gross domestic product shrank by 2.4 percent in the fourth quarter of last year from the previous quarter, after seasonal adjustments. That fall followed a decline of 1.6 percent in the third quarter. A recession occurs, by some definitions, after two quarters of contraction.

A global economic slowdown has reduced demand for Turkish exports and raised the cost of credit for its businesses. Growth in the European Union, Turkey’s most important market, has slowed to a crawl while Italy is in recession and Germany close to one.