Abdu'r-Rahman ibn Mu'awiya, arrived in Andalus after spending five years travelling across the North African desert as a fugitive, fleeing from the Abbasids who had seized power from the Umayyads. He landed in Andalus in 755 CE and soon many people rallied around him. He captured Cordoba on the day of the 'Id al-Adha 756 CE. In 777, an envoy from the Abbasid Khalifate visited King Charlemagne in the south of France. They arranged to incite a rebellion within Andalus with the help of Abbasid supporters which was to coincide with an invasion from the north led by Charlemagne. Abdur-Rahman quelled the Abbasid uprising before Charlemagne could cross into Andalus. When Charlemagne did finally enter the country in 778, he was soon forced to retreat, and suffered great losses in the famous ambush at Roncesvalles. Later, Charlemagne came to an agreement with Abdur-Rahman not to invade Andalus, even offering him his daughter as a wife, an offer which Abdur-Rahman politely declined.
'Abdu'r-Rahman I began the building of the great mosque in Cordoba in 786. He was also responsible for the building of a thick, strong wall around Cordoba. Furthermore, he ensured that mosques, public baths, bridges and castles were erected in every province of his dominions. The Muslims introduced the cultivation of sugar-cane, cotton and rice, as well as fruits such as the peach, the orange, the pomegranate and the date-palm. Not a patch of land was left uncultivated by their indefatigable efforts, and Andalus was filled with growth. They were unsurpassed in all the skilful trades. They started the culture of silk in Andalus, and it was through them that the arts of making paper and glass eventually passed into Europe. The potteries of Malaga, the cloth of Murcia, the silk of Almeria and Granada, the leather hangings of Cordoba, the weapons of Toledo, were renowned everywhere. Their strict fidelity to their engagements became proverbial. The Muslims were temperate in their behaviour and in satisfying their appetites. There were no beggars among them, for they took affectionate care of their poor and their orphans. As Andalus became renowned for its prosperity, people from all over the known world flocked to live there, and its new capital, Cordoba, became a centre of learning and knowledge.