You prayer is valid in sha Allah but you made a mistake in repeating it.

When I went for Tajweed class, during the Asr time, sisters made their own jama’ah after the adhan in the cellphone but I did not join them. Then the imam made adhan and I waited for half an hour for the iqama. But there is no one in the brother’s section so I started to pray alone. when I finished praying, the imam called for the iqama so then again I joined the imam in salah. Is my salah valid?

Prayer |