It is the story of Balaam son of Beor; this worshiper who deteriorated and declined to become a disobedient of God, after worshiping God for 1000 months (which may equal about 80 years
He was in the land of Moab, in the time of Prophet Joshua
It is mentioned in the Quran as a parable and example to the Jews at the time of Prophet Mohammed .. this parable extends till the present time
The parable of the dog which keeps barking at you whether you attack so as to beat it, or you leave it