[What you need to know to start the day: Get New York Today in your inbox.]

Anthony D. Weiner, the former New York congressman, walked out of a halfway house on Tuesday morning after his release from federal custody and told reporters, “I hope to be able to live a life of integrity and service.”

It was an optimistic note for a once-brash politician who was a rising Democratic star until multiple sexting scandals ended his political career, strained his marriage and, ultimately, got him sent to federal prison.

Despite his fall from grace, Mr. Weiner sounded hopeful after serving 18 months of a 21-month sentence that he received in 2017 for sending sexually explicit texts to a minor.

“I am glad to be getting back to my family,” Mr. Weiner, 54 , said, according to video posted by Fox News. He added, “I’m glad this chapter of my life is behind me.”