Mayor Sheila Dixon of Baltimore, who was convicted of embezzlement last month, said Wednesday that she would resign from office in early February as part of a deal negotiated with prosecutors.

Under the agreement, Ms. Dixon will not seek a new trial or run for city or state office before her probation ends. She agreed to contribute $45,000 to charity and will also plead guilty to certain counts of an outstanding perjury indictment.

In return, Ms. Dixon will receive four years of unsupervised probation and keep her $84,000-a-year pension.

Ms. Dixon, 56, was convicted on Dec. 1 of misappropriating about $500 in gift cards donated to the city for needy families when she was City Council president. She became mayor in 2007 and will be succeeded by the current City Council president, Stephanie Rawlings-Blake.