Andrew Hastie has retained his Liberal seat of Canning in a close contest with Labor candidate Amanda Hunt.
With 99 per cent of the votes counted, Mr Hastie surpassed Ms Hunt by a margin of 5872 votes.
Mr Hastie attracted 54.12 per cent of votes in the Canning electorate, compared to Ms Hunts 45.88 in the two party preferred contest.
Despite the victory, Mr Hastie suffered a 7.44 per cent swing away from the Liberals, meaning the seat is now marginal.

Labor Leader Anthony Albanese with Canning candidate Amanda Hunt. PIC: Facebook
'Prognosis terrifying' for young boy struck by car in Cooloongup
K9 Rescue's long-term resident in desperate search for loving home
West Coast Radio announcer Darragh O’Dea takes out Best Local Show at Australian Audio Awards
Lucky escape for two people after boat smashes into Mandurah Estuary Bridge
Secret Harbour Golf Links to host WA's most prestigious golf tournament
Upgrades begin on Kwinana Loop Trail
Shire of Harvey councillors vote in favour of city status
Erskine syndicate shares in division one Lotto win
Man accused of chasing down boy in Greenfields car park before assaulting him and stealing bicycle