It was narrated from 'Uthman bin Abul-'As that:The Messenger of Allah commanded him to build the mosque of Ta'if in the place where the Taghuts used to be.
حَدَّثَنَا مُحَمَّدُ بْنُ يَحْيَى، حَدَّثَنَا أَبُو هَمَّامٍ الدَّلاَّلُ، حَدَّثَنَا سَعِيدُ بْنُ السَّائِبِ، عَنْ مُحَمَّدِ بْنِ عَبْدِ اللَّهِ بْنِ عِيَاضٍ، عَنْ عُثْمَانَ بْنِ أَبِي الْعَاصِ، أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ أَمَرَهُ أَنْ يَجْعَلَ مَسْجِدَ الطَّائِفِ حَيْثُ كَانَ طَاغِيَتُهُمْ .
IbnMaja
The Book On The Mosques And The Congregations • Hadith 743