The origin of the Samaritans, as described in the book of Kings, is a group of people brought from Mesopotamia to Samaria by the Assyrians:
The king of Assyria brought people from Babylon, Cuthah, Avva, Hamath, and Sepharvaim, and placed them in the cities of Samaria in place of the people of Israel; they took possession of Samaria, and settled in its cities. (2 Kings 17:24 NRSV)
This also seems to be their origin story in Ezra 4:10.
However, they seem to be described later as having been taken out of the land of Egypt by God.
The Lord had made a covenant with them and commanded them, “You shall not worship other gods or bow yourselves to them or serve them or sacrifice to them, but you shall worship the Lord, who brought you out of the land of Egypt with great power and with an outstretched arm; you shall bow yourselves to him, and to him you shall sacrifice. [...]” (2 Kings 17:35-36)
This is presumably a reference to the Children of Israel's exodus from Egypt. Why are the Samaritans described as having been taken out of Egypt according to the story given previously which says they came from Mesopotamian cities?
Could the word "with them" (אִתָּם) in 17:35 refer to the "children of Jacob" mentioned in the previous verse? It seems to refer to the Samaritans, and not to the Israelites, because it concludes by saying (v. 40) that they continued to practice their former custom, which makes more sense in the context of the Samaritans (as in v. 34).
It would seem from the fact that the Samaritans (at least the Samaritans of a later period) accept the Pentateuch that they might have believed themselves to have been part of the exodus. To my knowledge, the Bible doesn't give any other account of the Samaritans being part of the exodus from Egypt.
Does this sentence in fact mean to say that the Samaritans were part of the exodus from Egypt?