His brother Riyasatullah Khan was his legal counsel. While in jail, Ashfaqulla Khan recited the Quran and started saying his prayers regularly and during the Islamic month of Ramadan strictly fasted. The case for the Kakori dacoity was concluded by awarding death sentence to Bismil, Ashfaqulla Khan, Rajendra Lahiri and Thakur Roshan Singh.