Bible
The Lord strikes Pharaoh with a plague because of Sarai
After receiving the Abrahamic Covenant and learning about the Promised Land of Canaan, Abram traveled in Canaan until severe famine drove him to Egypt. In Egypt, he lied about Sarai being his sister. The princes praised her beauty to Pharaoh, so she was taken into Pharaoh's house. The Lord struck him and his house with great plagues, so Pharaoh returned her, accused Abram of lying, and sent them away.(Genesis 12)
David's Judgement, a three-day plague
Near the end of David's reign, the LORD had him conduct a census, then afterward his heart struck him. The LORD sent Gad, saying, "Go and say to David, ‘Thus says the Lord, Three things I offer you. Choose one of them, that I may do it to you.’” He said, “Shall three years of famine come to you in your land? Or will you flee three months before your foes while they pursue you? Or shall there be three days' pestilence in your land? Now consider, and decide what answer I shall return to him who sent me.” David answered, “I am in great distress. Let us fall into the hand of the Lord, for his mercy is great; but let me not fall into the hand of man.”
The LORD sent a pestilence on Israel from morning until the appointed time. 70,000 men died between the people from Dan to Beersheba. When the angel stretched out his hand toward Jerusalem to destroy it, the LORD relented from the calamity and said, “It is enough; now stay your hand.” The angel of the LORD was by the threshing floor of Araunah the Jebusite, and David saw him striking the people and said to God, "Behold, I have sinned, and I have done wickedly. But these sheep, what have they done? Please let your hand be against me and against my father's house.”
Gad told him that day to raise an altar to the LORD on the threshing floor of Araunah the Jebusite, and after the burnt offerings and peace offerings, the LORD responded to the plea for the land. The plague was averted from Israel.