The mosque complex, which is due to be opened on Thursday,
includes an Islamic centre, gardens and a terrace looking out over the Sierra Nevada mountains and the Alhambra palace.
Catholic monarchs Ferdinand and Isabella in 1492 took control of the Alhambra when its last Muslim sultan, Boabdil, handed over the keys to the citadel in tears.
The mosque project has been in the making for 20 years.
It was initially funded by Libya and then taken up by Shaikh Ben Muhammad al Kassimi, the Emir of Sharjah in the United Arab Emirates, who put up most of the $4.5 million needed to construct the mosque.
Other Muslim states, notably Morocco, Brunei and Malaysia, also contributed money.
The project ran into difficulties with the death of Morocco's King Hassan II, who was very attached to the scheme, and the discovery of archaeological remains that halted the building work for some time.
Five years after the first stone was laid, the white mosque now graces the hill that once dominated the Arab quarter of medieval Granada.
Truth about Islam
The president of the mosque foundation, Malek Ruiz, said in a news conference that he hoped the religious complex would "become a place of reference for everyone who wants to discover the purest tradition of Islam.”
"The truth about Islam can be presented to Spaniards and
Europeans from this historic Muslim city," he said.
The mosque will be not only a place of prayer but a centre for public study, research, exhibitions and conferences.
The mosque foundation will be run by a seven-member council -- four representatives of Spain's Muslim community and three representatives appointed by the Emir of Sharjah, who is expected to be present at Thursday's inauguration ceremony.