After months in which his campaign struggled to find its footing, Bill de Blasio is now the front-runner in the Democratic primary for mayor of New York, according to a survey released on Wednesday.

The survey by Quinnipiac University found 36 percent of likely Democratic voters backed Mr. de Blasio, the public advocate. Christine C. Quinn, the City Council speaker, who had long been the front-runner among Democrats, was backed by 21 percent, while William C. Thompson Jr., who in 2009 won the Democratic primary but lost the general election to Mayor Michael R. Bloomberg, had 20 percent.

The results confirm a remarkable surge in support for Mr. de Blasio among likely Democratic voters, who tend to be significantly more liberal than the general electorate.

Mr. de Blasio has staked out liberal positions in several areas, pledging to raise taxes on the wealthy to finance early childhood education, railing against the Police Department’s stop-and-frisk practice and vowing to break with Mr. Bloomberg on multiple issues.