BALTIMORE — Catherine Pugh, the former mayor of Baltimore, who swept into office three years ago pledging to restore integrity in a city grappling with corruption, entrenched economic inequality and pervasive violence, pleaded guilty on Thursday to federal crimes tied to a children’s book series she wrote.

Ms. Pugh, 69, spoke barely above a whisper as she appeared in a courtroom to plead guilty to four counts as part of a plea agreement. At several moments during the hearing, she appeared to be close to tears, at one point seeming to gasp for air as she listened to prosecutors reading the charges against her.

Ms. Pugh, a Democrat who resigned as mayor in May, could face decades in prison when she is sentenced in February. The charges — wire fraud conspiracy, conspiracy to defraud the government and two counts of tax evasion — carry a maximum penalty of 35 years in prison.

A federal grand jury indicted Ms. Pugh after the F.B.I. investigated a scheme in which a series of children’s books she wrote, known as “Healthy Holly” books with titles like “Exercising Is Fun” and “Vegetables Are Not Just Green,” was used to defraud health care companies, Baltimore’s school system and taxpayers.