Williams served as a North Shore City councillor between 2001–2004, and Takapuna community board member between 2004–2007. He was a Hearings Commissioner from 2001–2010. In 2007 he won election as Mayor of North Shore City, New Zealand's fourth-largest city at the time. North Shore City Council was abolished in October 2010, becoming part of the Auckland "Super City". Williams was an outspoken critic of the "Super City" amalgamation process for Auckland instigated by the National-led government in its first term of 2008–2011, considering the proposed "Supercity" unnecessary and undemocratic. He called the political moves towards forced unification a railroaded process and a power grab. Personal relations with Auckland City's mayor John Banks reportedly turned sour, with Banks calling Williams "a lunatic" in a text message Banks accidentally sent to Williams, after Williams had accused Rodney Hide of misleading the Prime Minister on the amount of consultation with local authorities on the "Super City" proposal. On 15 August 2008, Williams collapsed while attending a Devonport naval base function. While being treated by ambulance workers, Williams is said to have "lashed out" at those helping him. The ambulance staff filed an incident report, but did not recommend further action. Williams' wife Jane said her husband was suffering from "Chinese lurgy" after having just arrived back from an exhausting 10-day trip to Korea and China as a guest of both those governments. She described the incident as an unconscious reaction of Williams as the medics treated him, and expressed surprise that the media had been told of it even though it should have been covered by patient confidentiality. Local newspapers were critical of Williams' first year in the Mayor's office, with one tabloid paper asking the question "Is the mayor mad?" and noting that his behaviour was described as "overbearing, controlling, heavy-handed". Williams defended himself as not having "a lot of patience for fence-sitters and procrastinators", and this was shown to be the case by the significant results the city achieved during his three years of mayoralty. Williams has been involved in a number of heated incidents – such as during a meeting of a committee of the North Shore City Council, where he was asked to leave after referring to a councillor, Chris Darby, as a "smart-arse". Darby was part of a minority of councillors who constantly opposed the policies and actions by what the media called Mayor Andrew's "A Team". Regarding the then-proposed Super City, Williams instead called for retention of the local Councils as they existed as of 2009, with a stronger Auckland Regional Council that could allegedly be made more accountable by being made up of local authority councillors instead of being elected separately and being forced to "work in a silo", "with insufficient funding". The position taken by Williams and the North Shore City Council was in line with the final report and recommendations of the Royal Commission on Auckland Governance. Williams was accused of sending a late night text to North Shore-based Government MPs, including Prime Minister John Key. Williams was expressing his great disappointment of their final vote approving the SuperCity. In July 2010, he announced that he would stand in the 2010 mayoral election for the new 'Supercity' and for the Albany ward on the new council. His aim was not to win but to reduce votes for John Banks on the North Shore. He retired as the final Mayor of North Shore City after a council meeting on the last day of the city's legal existence on 31 October 2010.
He represented New Zealand First in the North Shore in the 2011 general election. Although New Zealand First won no electorate seats, Williams was elected as a list Member of Parliament as New Zealand First's 6.8% of the party vote entitled it to eight seats in Parliament. Williams himself only received just over 800 votes. On 26 August 2014, New Zealand First released their parliamentary list for the 2014 New Zealand general election. Williams was excluded, effectively ending his parliamentary career. Following his electoral defeat, Williams and his wife retired to Taupo.