The Old Testament law specifically required prayer and fasting for only one occasion, which was the Day of Atonement. This custom became known as “the day of fasting” (Jeremiah 36:6) or “the Fast” (Acts 27:9). Moses fasted during the 40 days and 40 nights he was on Mount Sinai receiving the law from God (Exodus 34:28). King Jehoshaphat called for a fast in all Israel when they were about to be attacked by the Moabites and Ammonites (2 Chronicles 20:3). In response to Jonah’s preaching, the men of Nineveh fasted and put on sackcloth (Jonah 3:5). Prayer and fasting was often done in times of distress or trouble. David fasted when he learned that Saul and Jonathan had been killed (2 Samuel 1:12). Nehemiah had a time of prayer and fasting upon learning that Jerusalem was still in ruins (Nehemiah 1:4). Darius, the king of Persia, fasted all night after he was forced to put Daniel in the den of lions (Daniel 6:18).
Prayer and fasting also occurs in the New Testament. Anna “worshipped night and day, fasting and praying” at the Temple (Luke 2:37). John the Baptist taught his disciples to fast (Mark 2:18). Jesus fasted for 40 days and 40 nights before His temptation by Satan (Matthew 4:2). The church of Antioch fasted (Acts 13:2) and sent Paul and Barnabas off on their first missionary journey (Acts 13:3). Paul and Barnabas spent time in prayer and fasting for the appointment of elders in the churches (Acts 14:23).