Mexico’s economy contracted in the second quarter for the first time in three years as growth in the services industry slowed and exports fell. Gross domestic product declined 0.3 percent from the first three months, according to preliminary figures released by the national statistics institute Friday. The median forecast of 13 economists surveyed by Bloomberg was for a contraction of 0.1 percent. From the previous year, GDP climbed 2.4 percent, in line with estimates. The institute will release final growth figures Aug. 22. Mexico has been hit by a slump in exports to the U.S., as well as falling oil prices and output that forced the government to cut spending. Adding to the problem is a slower expansion in domestic demand that had been the main source of growth for previous quarters in Latin America’s second-largest economy. “We’re seeing a moderation in services activity, which had been showing a vigorous expansion,” said Carlos Gonzalez Martinez, deputy director of economic studies at Bank of Nova Scotia in Mexico City. “The growth weakness could be temporary, and we still have the potential for a relatively favorable expansion for the rest of this year.” The preliminary GDP figure may have been affected by seasonality factors, including the timing of Easter week, the Finance Ministry’s chief economist, Luis Madrazo, said at a news conference Friday. The government hasn’t modified its growth forecasts for this year after the GDP report, Madrazo said. The peso strengthened 0.8 percent to 18.7494 per dollar at 2:45 p.m. in Mexico City. The currency weakened 8.9 percent this year through Thursday after the Federal Reserve raised its key rate in December, plunging oil prices reduced the revenue available to fund government outlays and global risks increased. Growth from a year earlier was led by farm activity, which climbed 4.2 percent, while services expanded 3.2 percent, less than the 3.7 percent in the first quarter. Industrial activity remained sluggish on muted export demand and manufacturing, which grew 0.8 percent. The pace of annual expansion weakened from 2.6 percent in the first quarter, the statistics institute said. Growth will slow this year to 2.4 percent from 2.5 percent in 2015, according to the median estimate of analysts surveyed by Bloomberg, after a slumping peso forced the central bank to borrowing costs to head off a pick-up in inflation from higher import costs. Banco de Mexico in 2016 has twice raised the key rate by a half-point to push the benchmark up to 4.25 percent. Falling output at state-owned oil producer Petroleos Mexicanos has been one of the main drags on the economy. The company extended more than three years of losses in the second quarter as a cash injection from the government failed to overcome the pinch of record-low crude output, refinery upsets and a petrochemical plant explosion. The company’s exploration was crimped by a reduction in its spending in the first quarter. “Activity has started to decelerate in part due to headwinds from the U.S. economy,” said Benito Berber, senior economist for Latin America at Nomura Holdings Inc., before Friday’s report. “The main engine for growth had been domestic consumption but now even this sector has started to decelerate.”