There was also a testy phone call between Mr. Trump and President Enrique Peña Nieto of Mexico that derailed tentative plans for the two leaders to meet after Mr. Trump refused to drop his demand that Mexico pay for the border wall.
For Mrs. Jacobson, the ambassadorial post was the culmination of a career largely centered in Washington, where she was most recently the assistant secretary for Western Hemisphere affairs. As a member of the State Department’s Civil Service — as opposed to the foreign service, which typically fills the ranks of diplomats — it was highly unusual for Mrs. Jacobson to have ascended to the top slot in Mexico.
But Mrs. Jacobson’s supporters say her extensive experience and connections in the country were crucial assets for Washington at a time of strain between the two neighbors, which have closely intertwined economies.
Former President Barack Obama named Mrs. Jacobson to the post in 2015, but a bitter partisan dispute in Congress meant nearly 11 months elapsed before she was confirmed. After she arrived in Mexico City, the honeymoon period did not last long.
Mr. Trump’s election abruptly changed the generally warm relations that the United States had developed with Mexico over the last 25 years — ones that Mrs. Jacobson had helped foster through much of her career. Mrs. Jacobson was left working with her Mexican counterparts to assuage growing concern — and anger — at the new president’s tough talk.
At the same time, diplomacy on Mexico was being routed through the White House, via the president’s son-in-law, Jared Kushner, which left Mrs. Jacobson with less authority.
Newsletter Sign Up
Thank you for subscribing.
An error has occurred. Please try again later.
You are already subscribed to this email.
Officials in Mexico, as well as former colleagues, lamented her departure, calling is the latest blow to strained Mexican-American relations.
“No career official has more consummately understood U.S.-Mexico relations,” said Carlos Pascual, a former American ambassador to Mexico and Ukraine. “She grounded American policy in the belief that, as neighbors, the U.S. and Mexico will gain most from using the vast resources of both countries to confront shared problems together.”
Mrs. Jacobson will be leaving a State Department that has seen an exodus of foreign service officers.
Among those leaving are several high-ranking officials with deep experience in Latin America, including Thomas A. Shannon Jr., the third-highest ranking official in the State Department. Mr. Shannon, the under secretary of state for political affairs who previously served as an ambassador to Brazil, Guatemala and Venezuela, announced his retirement last month.
While Mr. Shannon said his decision had been made for personal reasons, the departure of another official, John Feeley, the ambassador to Panama, was more politically tinged. In his resignation letter this year, Mr. Feeley said he was leaving a long career in the government service because he felt he could no longer serve Mr. Trump.
In her letter to staff, Mrs. Jacobson focused mostly on the work she and her team had done during her tenure, and did not take any shots at the president.
“You have respected everyone you came in contact with — Mexican, American, or from anywhere else, reflecting the better angels of our nature,” she wrote. “You know how great our two countries are. And that we are stronger together.”
Mrs. Jacobson began her career at the State Department as a presidential management intern in 1986, during the Reagan administration, after graduating from the Fletcher School of Law and Diplomacy at Tufts University. Three years later she was transferred to the Western Hemisphere sector, where she remained for practically the rest of her career.
Her interest in the area stemmed from the embrace of democracy that spread through the region in the 1980s, just as she was leaving college.
She served in numerous roles in Washington, including as deputy secretary for Western Hemisphere affairs for five years before she moved to Mexico, where she was a key broker in the agreement to re-establish relations between Cuba and the United States during the Obama administration.