MEXICO CITY (Reuters) - Mexico’s economy shrank in the second quarter for the first time in three years, dragged down by the deepest slump in industrial output since 2009, and the government revised down its 2016 outlook, but it was not seen sliding into recession soon.

Buildings stand shrouded in smog in Mexico City, March 16, 2016. REUTERS/Edgard Garrido

The contraction comes after a slump in crude oil prices hammered Mexico’s economy and after the central bank aggressively hiked its benchmark rate in June following a sharp depreciation of the local peso.

Gross domestic product contracted by 0.2 percent from the prior quarter MXGDPQ=ECI, seasonally-adjusted data from national statistics agency (INEGI) showed on Monday. Preliminary data in July showed a 0.3 percent slump and the economy grew a downwardly revised 0.5 percent in the first quarter.

The industrial sector, which includes manufacturing and crude production, contracted by 1.5 percent from the January-March period, its biggest drop since the first quarter of 2009.

Deputy Finance Minister Fernando Aportela told a news conference the government had revised down its 2016 growth outlook to 2.0-2.6 percent from a prior range of 2.2-3.2 percent, citing “unfavorable external conditions”.

Aportela also said the government was lowering its public sector borrowing requirement for 2016 to 3 percent of GDP.

“It is not unlikely that this is the beginning of a softer growth path in Mexico,” said Benito Berber, an analyst at Nomura in New York, adding that the prospect of a recession had increased but was still unlikely.

Weak demand in the United States for Mexican-made goods has weighed on Latin America’s second biggest economy.

Mexico’s services sector, previously a driver of growth, posted a 0.1 percent expansion while agricultural output dipped 0.3 percent, the data showed.

Compared with the second quarter of 2015, gross domestic product (GDP) expanded 2.5 percent MXGDPY=ECI, following preliminary figures which showed a 2.4 percent expansion. Growth was 2.4 percent in the first quarter versus the year-ago period.

A separate report showed economic activity rose 0.6 percent in June compared to the prior month MXIGAE=ECI on a pick-up in agriculture and services. The economy grew in June by 2.2 percent compared to the same month last year MXIGDP=ECI, the data also showed.

“We doubt that the economy will continue to contract (in q/q terms) in the second half of this year,” Capital Economics said in a client note, forecasting full-year growth of 2 percent.

Mexico’s central bank held borrowing costs steady this month, flagging weaker growth and warning that uncertainty around the U.S. presidential election might cause deeper peso losses that could fan inflation.

That followed a unanimous 50-basis-point hike in June to keep a weak peso from hitting consumer prices.