Image caption Anthony Weiner resigned in June 2011 after pressure from fellow Democrats

A former congressman who resigned in disgrace over his racy Twitter messages has announced he will run for mayor of New York City.

Anthony Weiner enters the race with one poll ranking him second in the contest for the Democratic mayoral nomination.

In 2011, he had said his account was hacked, then admitted sending half-nude photos to young women.

Mr Weiner already has almost $5m (£3.3m) in campaign funds ahead of the city's mayoral election this November.

In a YouTube video released late on Tuesday, the former New York representative said: "I made some big mistakes and I know I let a lot of people down, but I also learned some tough lessons.

"I'm running for mayor because I've been fighting for the middle class and those struggling to make it my entire life. And I hope I get a second chance."

He previously ran for mayor in 2005 and was expected to do so again in 2009 before current Mayor Michael Bloomberg said he would run for a third term.

In recent interviews, Mr Weiner has said he should not have lied about the photos he posted on Twitter, but did so because he wanted to keep the truth from his then-pregnant wife, Huma Abedin.

Ms Abedin, a longtime aide of former US Secretary of State Hillary Clinton, has said she has forgiven him.

Mr Weiner faces several rivals for the Democratic mayoral nomination, which will be decided at a primary election in September.

A Quinnipiac University poll released on Wednesday places Mr Weiner second with 15% of the vote, trailing City Council Speaker Christine Quinn by 10 points.

Public Advocate Bill de Blasio and former city Comptroller Bill Thompson both followed with 10% of the survey.

But the poll, conducted before Mr Weiner's announcement, also found nearly half of city voters said he should not enter the race for mayor.

However, Mr Weiner may have taken encouragement from another disgraced politician who recently made a comeback.

This month, former South Carolina Governor Mark Sanford, who quit following an extramarital affair, was elected to the US Congress.