Alejandro Gaytan, head of the finance ministry's economic planning unit, said in an interview that a 1% primary budget surplus - a figure which strips out payments on existing debts -was still achievable this year.
"We think the development of public finances in the first half of this year is compatible with maintaining this measure," Gaytan told Reuters. "In the second half of the year, we expect increased economic activity for various reasons."
Mexican gross domestic product increased 0.1% between April and June from the prior quarter, narrowly averting a recession that would have dealt a major blow to President Andres Manuel Lopez Obrador's promise to boost the $1.2 trillion economy.
Lopez Obrador is having to make tough choices as Mexican state oil company Pemex, one of the largest contributors to the country's budget, is at risk of losing its investment grade rating over its large debt burden.
Such a downgrade to "junk" status could cripple Lopez Obrador's energy agenda, along with his plans to use new oil revenue to help finance social welfare programs. It could also imperil Mexico's sovereign creditworthiness.
Ratings agencies have not changed their negative outlook on Pemex after tax cuts for the company were announced, arguing it was too little and too late. Gaytan declined to say whether the government planned other measures to help the ailing company.
While Mexico may have avoided a recession, some critics of Lopez Obrador's policies argue that the economy has been underperforming for months and that his growth targets are unrealistic.
The president is forecasting growth of 2% in 2019.
Even so, Gaytan said that the $25 billion spending package announced by Finance Minister Arturo Herrera this week, as well as the ratification of the new United States-Mexico-Canada free trade deal, would help boost the Mexican economy.
For that package, Herrera said the government would tap an infrastructure fund and bring some planned spending forward while also providing additional credit lines, all without impacting the budget.
"It will give more certainty and dispel doubts so that certain investments can be made," Gaytan said. "We're committed to finding ways to boost the economy ... while maintaining fiscal targets.