On the eve of a budget fight, Mayor Carlos Gimenez’s new chief of staff is resigning.

Lisa Martinez took the job as the mayor’s top aide only in February, but she now plans to leave her post early next month, the mayor’s office confirmed on Friday. Hours later, the mayor issued a statement saying that Alex Ferro, currently head of external affairs for Gimenez, will take over as chief of staff once Martinez departs on Aug. 4.

Martinez, a well-liked former teacher, moved over as Gimenez’s senior aide earlier this year when his chief of staff at the time, Chip Iglesias, was shifted to a full-time deputy mayor. Prior to joining Miami-Dade, Martinez worked as an administrator in Miami-Dade’s school system and as head of policy for then-Miami Mayor Manny Diaz.

News of the departure comes just four days before a scheduled face-off with county commissioners over a proposed budget that includes 674 job cuts in order to avoid an increase in the property-tax rate. Martinez presided over Gimenez’s effort to restructure the library system, which faces a $20 million budget gap tied to his 2011 tax cut. Gimenez ultimately proposed a library budget that cuts $5 million from the current spending plan and will replace 90 full-time employees with part-time hires.

On Friday afternoon, Gimenez issued a statement praising Martinez, which said in part: “Lisa has been a valuable member of my senior executive team and a trusted adviser whose counsel will be missed.”

Ferro’s relationship with Gimenez dates back to the mayor’s 2011 election. Ferro had worked on the campaign of Marcelo Llorente, who endorsed Gimenez after placing third in the first round of the race.Gimenez then inherited some of Llorente’s staff.

The 33-year-old Ferro comes from a political family. Llorente, who is now a lobbyist along with his brother, is Ferro’s cousin. His father, Simon Ferro, is a well-known land-use attorney. Alex Ferro was once chief of staff to former Lt. Gov. Jeff Kottkamp and executive director for the Florida Hispanic Legislative Caucus.

His wife, Lani Ferro, is director of external affairs for Miami Children's Hospital and in April registered to lobby for the nonprofit, according to county records. Deputy Mayor Jack Osterholt said the hospital sought an economic-development grant from a program tied to a 2004 county bond issue, but ultimately didn’t match the criteria.

Martinez’s exit from her $180,000-a-year job is one of the most high-profile of Gimenez’s three-year tenure, given her recent promotion and the heft of her title. It comes two months after Gimenez’s top communications aide, Fernando Figueredo, left for a post at Florida International University, and his chief spokeswoman, Suzy Trutie, transferred to run marketing at the county-owned Vizcaya Museum & Gardens.

As of Friday afternoon, Martinez had not responded to requests for an interview.

In a letter of resignation released Friday morning, Martinez wrote that she was recently informed that she is one of six finalists to run an unnamed nonprofit focused on children.

“This process, albeit incomplete, has led me to reflect on my professional and personal priorities,” Martinez wrote in the letter, dated Wednesday. “As an educator, my passion for helping children and families is something I cannot ignore and is calling me back into this line of service.”

“It has become clear to me that it is time for me to seek out professional opportunities and challenges that will directly align with these priorities,” she continued.

Martinez expressed “deep appreciation” for the opportunities Gimenez provided her in county government. “The three years since I joined your team have gone by so quickly,’’ she wrote. “I have always tried to do my very best for you and for the Miami-Dade residents we serve.”

The timing of Martinez’s departure is significant, since Gimenez is in the middle of the county’s annual budget season. Part of the chief of staff’s job is to communicate the mayor’s agenda to commissioners who must set the property-tax rate and approve the budget.

Xavier Suarez, a county commissioner who often publicly spars with Gimenez, said Martinez’s planned exit caught him off guard. “She was good to work with,” he said. “She was one of the quickest people to respond as anyone in the administration we’ve dealt with at that level.”