9 But there was a man named Simon, who had previously practiced magic in the city and amazed the people of Samaria, saying that he himself was somebody great. 10 They all paid attention to him, from the least to the greatest, saying, “This man is the power of God that is called Great.” 11 And they paid attention to him because for a long time he had amazed them with his magic. 12 But when they believed Philip as he preached good news about the kingdom of God and the name of Jesus Christ, they were baptized, both men and women. 13 Even Simon himself believed, and after being baptized he continued with Philip. And seeing signs and great miracles performed, he was amazed.
14 Now when the apostles at Jerusalem heard that Samaria had received the word of God, they sent to them Peter and John, 15 who came down and prayed for them that they might receive the Holy Spirit, 16 for he had not yet fallen on any of them, but they had only been baptized in the name of the Lord Jesus. 17 Then they laid their hands on them and they received the Holy Spirit. 18 Now when Simon saw that the Spirit was given through the laying on of the apostles' hands, he offered them money, 19 saying, “Give me this power also, so that anyone on whom I lay my hands may receive the Holy Spirit.” 20 But Peter said to him, “May your silver perish with you, because you thought you could obtain the gift of God with money! 21 You have neither part nor lot in this matter, for your heart is not right before God. 22 Repent, therefore, of this wickedness of yours, and pray to the Lord that, if possible, the intent of your heart may be forgiven you. 23 For I see that you are in the gall of bitterness and in the bond of iniquity.” 24 And Simon answered, “Pray for me to the Lord, that nothing of what you have said may come upon me.”
25 Now when they had testified and spoken the word of the Lord, they returned to Jerusalem, preaching the gospel to many villages of the Samaritans. (ESV)