Khalid ibn al-Walid
Ancestry and early life: Khalid's father was al-Walid ibn al-Mughira, an arbitrator of local disputes in Mecca in the Hejaz (western Arabia). Al-Walid is identified by the historians Ibn Hisham (d. 833), Ibn Durayd (d. 837) and Ibn Habib (d. 859) as the "derider" of the Islamic prophet Muhammad mentioned in the Meccan suras (chapters) of the Qur'an. He belonged to the Banu Makhzum, a leading clan of the Quraysh tribe and Mecca's pre-Islamic aristocracy. The Makhzum are credited for introducing Meccan commerce to foreign markets, particularly Yemen and Abyssinia (Ethiopia), and developed a reputation among the Quraysh for their intellect, nobility and wealth. Their prominence was owed to the leadership of Khalid's paternal grandfather al-Mughira ibn Abd Allah. Khalid's paternal uncle Hisham was known as the 'lord of Mecca' and the date of his death was used by the Quraysh as the start of their calendar. The historian Muhammad Abdulhayy Shaban describes Khalid as "a man of considerable standing" within his clan and Mecca in general.
Khalid's mother was al-Asma bint al-Harith ibn Hazn, commonly known as Lubaba al-Sughra ('Lubaba the Younger', to distinguish her from her elder half-sister Lubaba al-Kubra) of the nomadic Banu Hilal tribe. Lubaba al-Sughra converted to Islam about c. 622 and her paternal half-sister Maymuna became a wife of Muhammad. Through his maternal relations Khalid became highly familiarized with the Bedouin (nomadic Arab) lifestyle.

Early military career: 

Opposition to Muhammad: The Makhzum were strongly opposed to Muhammad, and the clan's preeminent leader Amr ibn Hisham (Abu Jahl), Khalid's first cousin, organized the boycott of Muhammad's clan, the Banu Hashim of Quraysh, in c. 616–618. After Muhammad emigrated from Mecca to Medina in 622, the Makhzum under Abu Jahl commanded the war against him until they were routed at the Battle of Badr in 624. About twenty-five of Khalid's paternal cousins, including Abu Jahl, and numerous other kinsmen were slain in that engagement.

The following year Khalid commanded the right flank of the cavalry in the Meccan army which confronted Muhammad at the Battle of Uhud north of Medina. According to the historian Donald Routledge Hill, rather than launching a frontal assault against the Muslim lines on the slopes of Mount Uhud, "Khalid adopted the sound tactics" of going around the mountain and bypassing the Muslim flank. He advanced through the Wadi Qanat valley west of Uhud until being checked by Muslim archers south of the valley at Mount Ruma. The Muslims gained the early advantage in the fight, but after most of the Muslim archers abandoned their positions to join the raiding of the Meccans' camp, Khalid charged against the resulting break in the Muslims' rear defensive lines. In the ensuing rout, several dozen Muslims were killed. The narratives of the battle describe Khalid riding through the field, slaying the Muslims with his lance. Shaban credits Khalid's "military genius" for the Quraysh's victory at Uhud, the only engagement in which the tribe defeated Muhammad.
In 628 Muhammad and his followers headed for Mecca to perform the umra (lesser pilgrimage to Mecca) and the Quraysh dispatched 200 cavalry to intercept him upon hearing of his departure. Khalid was at the head of the cavalry and Muhammad avoided confronting him by taking an unconventional and difficult alternate route, ultimately reaching Hudaybiyya at the edge of Mecca. Upon realizing Muhammad's change of course, Khalid withdrew to Mecca. A truce between the Muslims and the Quraysh was reached in the Treaty of Hudaybiyya in March.

Conversion to Islam and service under Muhammad: In the year 6 AH (c. 627) or 8 AH (c. 629) Khalid embraced Islam in Muhammad's presence alongside the Qurayshite Amr ibn al-As; the modern historian Michael Lecker comments that the accounts holding that Khalid and Amr converted in 8 AH are "perhaps more trustworthy". The historian Akram Diya Umari holds that Khalid and Amr embraced Islam and relocated to Medina following the Treaty of Hudaybiyya, apparently after the Quraysh dropped demands for the extradition of newer Muslim converts to Mecca. Following his conversion, Khalid "began to devote all his considerable military talents to the support of the new Muslim state", according to the historian Hugh N. Kennedy.
Khalid participated in the expedition to Mu'ta in modern-day Jordan ordered by Muhammad in September 629. The purpose of the raid may have been to acquire booty in the wake of the Sasanian Persian army's retreat from Syria following its defeat by the Byzantine Empire in July. The Muslim detachment was routed by a Byzantine force consisting mostly of Arab tribesmen led by the Byzantine commander Theodore and several high-ranking Muslim commanders were slain. Khalid took command of the army following the deaths of the appointed commanders and, with considerable difficulty, oversaw a safe withdrawal of the Muslims. Muhammad rewarded Khalid by bestowing on him the honorary title Sayf Allah ('the Sword of God').

In December 629 or January 630, Khalid took part in Muhammad's capture of Mecca, after which most of the Quraysh converted to Islam. In that engagement Khalid led a nomadic contingent called muhajirat al-arab ('the Bedouin emigrants'). He led one of the two main pushes into the city and in the subsequent fighting with the Quraysh, three of his men were killed while twelve Qurayshites were slain, according to Ibn Ishaq, the 8th-century biographer of Muhammad. Khalid commanded the Bedouin Banu Sulaym in the Muslims' vanguard at the Battle of Hunayn later that year. In that confrontation, the Muslims, boosted by the influx of Qurayshite converts, defeated the Thaqif—the Ta'if-based traditional rivals of the Quraysh—and their nomadic Hawazin allies. Khalid was then appointed to destroy the idol of al-Uzza, one of the goddesses worshiped in pre-Islamic Arabian religion, in the Nakhla area between Mecca and Ta'if.
Khalid was afterward dispatched to invite to Islam the Banu Jadhima in Yalamlam, about 80 kilometers (50 mi) south of Mecca, but the Islamic traditional sources hold that he attacked the tribe illicitly. In the version of Ibn Ishaq, Khalid had persuaded the Jadhima tribesmen to disarm and embrace Islam, which he followed up by executing a number of the tribesmen in revenge for the Jadhima's slaying of his uncle Fakih ibn al-Mughira dating to before Khalid's conversion to Islam. In the narrative of Ibn Hajar al-Asqalani (d. 1449), Khalid misunderstood the tribesmen's acceptance of the faith as a rejection or denigration of Islam due to his unfamiliarity with the Jadhima's accent and consequently attacked them. In both versions Muhammad declared himself innocent of Khalid's action but did not discharge or punish him. According to the historian W. Montgomery Watt, the traditional account about the Jadhima incident "is hardly more than a circumstantial denigration of Khālid, and yields little solid historical fact".
Later in 630, while Muhammad was at Tabuk, he dispatched Khalid to capture the oasis market town of Dumat al-Jandal. Khalid gained its surrender and imposed a heavy penalty on the inhabitants of the town, one of whose chiefs, the Kindite Ukaydir ibn Abd al-Malik al-Sakuni, was ordered by Khalid to sign the capitulation treaty with Muhammad in Medina. In June 631 Khalid was sent by Muhammad at the head of 480 men to invite the mixed Christian and polytheistic Balharith tribe of Najran to embrace Islam. The tribe converted and Khalid instructed them in the Qur'an and Islamic laws before returning to Muhammad in Medina with a Balharith delegation.

Commander in the Ridda wars: After Muhammad's death in June 632, one of his early and close companions, Abu Bakr, became caliph (leader of the Muslim community). The issue of succession had caused discord among the Muslims. The Ansar (lit. 'Helpers'), the natives of Medina who hosted Muhammad after his emigration from Mecca, attempted to elect their own leader. Opinion was split among the Muhajirun (lit. 'Emigrants'), the mostly Qurayshite natives of Mecca who emigrated with Muhammad to Medina. One group advocated for a companion closer in kinship to Muhammad, namely his cousin Ali, while another group, backed by new converts among the Qurayshite aristocracy, rallied behind Abu Bakr.