Prior to the 1978 election, Anderson won Labor Party pre-selection for the seat of Nepean. At the subsequent election, which was a landslide victory for the ALP under Neville Wran, Anderson defeated the sitting Liberal Party member, Ron Rofe. However, he represented the electorate for only one term as it was abolished in a redistribution before the 1981 election. Anderson then represented the seat of Penrith replacing the previous member who moved to the seat of St Marys. In a shock result, Anderson lost the previously safe Labor seat at the 1988 election to the Liberals' Guy Matheson. Anderson's exile from state parliament was short-lived. In February 1989, former cabinet ministerGeorge Paciullo resigned from the seat of Liverpool, having lost a caucus ballot for the post of Opposition Leader. This resignation resulted in a bitter pre-selection struggle among local party members for the ensuing by-election. Support was divided between Mark Latham from Labor's Centre Unity faction and the left'sPaul Lynch. Intervention from the party's central office resulted in Anderson being imposed as the Labor candidate. Anderson was victorious at the by-election and the 1991 election. However, he failed to cement support amongst his local party members, and lost party pre-selection to Lynch prior to the 1995 election. By this time Anderson was seen as an ambitious and divisive threat to Bob Carr, and the party central office declined to intervene on his behalf or nominate him for the Legislative Council. Anderson's public political career ended at the 1995 election but he was subsequently appointed Chairman of the New South Wales Tow Truck Authority. In parliament Anderson was a prominent member of the right faction. His leadership aspirations became clear in 1986, when he was the only declared challenger to Barrie Unsworth's succession to Wran as Premier of New South Wales. He held prominent ministerial posts in the Wran and Unsworth Governments. He was the Minister for Police and Emergency Services from 1982 until 1986 and Minister for Corrective Services from 1983 until 1984. In 1986 he was the Minister for Local Government, Youth and Community Services and Aboriginal Affairs. In the Unsworth Government he was the Minister for Health.
Career after politics
In 2006, Anderson was appointed the Director of the Macquarie University Centre for Policing, Intelligence and Counter Terrorism. In July 2010, the New South Wales Independent Commission Against Corruption commissioned an independent investigation into a number of complaints by nine of twelve staff alleging bullying, victimisation and inappropriate recruitment practices. The investigation concluded "the practice of relying on direct appointments and short-term appointments and making ad hoc appointments in the absence of any planned approach to staffing has led to justifiable perceptions that the processes of recruitment and selection are corrupt." The report found evidence of bullying, victimisation and conflicts of interest by Anderson. In 2013, Peter Anderson retired and his position was advertised as vacant pending his retirement in December 2013.