Question: If the worshiper inadvertently engages in ‘ishā’ prayer before performing the maghrib prayer and realizes in the middle of the prayer that he has made a mistake, what is his duty?
Answer: If he is still before rukū‘ of the fourth rak‘ah, he should return the intention to the maghrib prayer and finish the maghrib prayer and then offer the ‘ishā’ prayer. But if he is in, or has performed, rukū‘ of the fourth rak‘ah, he should complete the ‘ishā’ prayer as a precaution, and then offer both maghrib and ‘ishā’ prayers.