He was elected to the New York State Senate in 1914, and became Mayor of New York City in 1926. The initial years of his mayorality were a prosperous time for the city, at least partially due to the proliferation of speakeasies during the Prohibition era. His affairs with "chorus girls" were widely known, and he left his wife for showgirl Betty Compton without impairing his popularity. He managed to maintain the five-cent subway fare despite a threatened labor strike. He even composed a popular song of the day, "Will You Love Me in December (as You Do in May)?".
His fortunes turned, with the economy, in 1929. Patrick Cardinal Hayes denounced him, implying the immorality of the mayor, both personal, and political, in tolerating "girlie magazines" and casinos, was a cause of the economic downturn.
Increasing social unrest led to the uncovering of corruption within his administration, and he was eventually forced to testify before the investigative committee of Judge Samuel Seabury (the Seabury Commission). Walker resigned from office in September 1932 and promptly fled to Europe until the danger of criminal prosecution appeared remote.