A by-election was held for the New South Wales Legislative Assembly seat of Penrith on 19 June 2010. The by-election was triggered by the resignation of sitting Labor member and former Parliamentary Secretary for Education and Training Karyn Paluzzano, who had lied to an Independent Commission Against Corruption (ICAC) inquiry over her actions, such as signing false staff payslips and rorting her electoral mail allowance. Paluzzano resigned from Cabinet after she admitted lying to ICAC. Paluzzano resigned from Parliament on 7 May 2010, hours after being suspended from the Labor Party.
Penrith had been in Labor hands for all but one term since its creation in 1974. Labor held it on a majority of 9.1%—a margin that would be considered on the stronger side of fairly safe under normal circumstances (any seat with a two-party margin between 6-10% is considered fairly safe on paper). However, the by-election came at a bad time for the government. In addition to the scandal surrounding Paluzzano, Labor was only polling at 39% support, a marked drop from the 2007 election. While Premier Kristina Keneally had invested considerable time into rehabilitating Labor's image since ousting Nathan Rees in a caucus coup, it was not enough to improve her party's standing in the polls.
The by-election was won by Liberal candidate Stuart Ayres with a 25.7-point two-party swing. The size of this swing, at the time, was the biggest against a sitting NSW government on record; previously, the highest swing was the 23.1 per cent swing achieved by the Liberal Party in the 2008 Ryde by-election. Additionally, this result marked the first time that the Liberal Party achieved a primary vote majority in Penrith, with the Labor primary vote having halved from the last election. Indeed, on paper it turned Penrith from a fairly safe Labor seat into a safe Liberal seat in one stroke. The two-party swing was to be outdone a few years later with a 26-point two-party swing against the Liberal government at the 2013 Miranda state by-election.