Labor has won a third term of government. Roger Cook will remain premier of Western Australia.