Ezra 8:21-23

21 Then I proclaimed a tzom there, at the Ahava River, that we might afflict ourselves before Eloheinu, to seek of Him a derech yesharah for us, and for our little ones, and for all our possessions.
22 For I was ashamed to require of the Melech a band of soldiers and parashim to protect us against the enemy on the road; because we had spoken unto the Melech, saying, The Yad Eloheinu is upon all them for tovah that seek Him, but His power and His wrath is against all them that forsake Him.
23 So we did a tzom and besought Eloheinu for this, and He was entreated of us.