Nigerian soldiers thwarted a Boko Haram attack Wednesday in the town of Biu in the restive northeastern section of the country, the military said in a tweet.