Labor's Magenta Marshall will replace Mark McGowan as the new member for Rockingham.
Ms Marshall won nearly 50 per cent of the primary vote in the by-election, followed by Liberal candidate Peter Hudson with 17.7 per cent and independent Hayley Edwards coming at third with 16 per cent.
Ms Marshall called the election victory around 7.30pm on Saturday.
"I'm honoured to be elected as the new member for Rockingham! I'll always stand up for our community," Marshall said in a Facebook post.
Despite the win, Labor's primary vote fell more than 30 per cent since Mark McGowan's landslide election victory in 2021, which saw him receive 83 per cent of the primary vote.

Police investigate stabbing of two men at Warnbro home
Shark sighted in Dawesville Channel
City of Rockingham has highest number of households receiving rent relief
Man fined thousands for keeping dozens of undersize blue swimmer crabs caught off Coodanup Foreshore
2026 Mandurah ArtsĀ Festival to feature month-long program of performances, workshops
Candidates locked-in for Rockingham council vacancy
Man charged over alleged cruelty towards German Shepherd in Baldivis
Calls for improved safety after three major crashes on Forrest Highway in West Pinjarra
Rockingham Flames crowned 2026 NBL1 West champions
