On Abd al-Rahman's arrival, Andalusian forces were divided, with both commanders claiming the allegiance of both Berbers and the Syrian . Generally, Yemeni units within the latter joined the Umayyad contender, while their Mudar and Qays rivals remained loyal to Yusuf. After attempting a failed compromise with Abd al-Rahman by which the Umayyad survivor would succeed him, Yusuf al-Fihri was defeated at the Battle of Musarah just outside Córdoba in March 756 by Abd al-Rahman, who thus became the first independent Emir of Córdoba.