Al-Shawaf was born in Baghdad to the prominent al-Shawaf clan of Iraq, a religious and landowning Sunni Muslim family. He attended the Baghdad Military College, then the Baghdad Staff College. He was classmates with Nazim Tabaqchali and Abdul Salam Arif. Al-Shawaf later attended the Senior Officers' School in the Great Britain. While author Mehdi Herav suggests that al-Shawaf ideologically leaned towards the Ba'ath Party, author Juan Romero says he leaned towards the National Democratic Party, who were moderate socialists.
Al-Shawaf was a member of the original Free Officers group, which plotted the overthrow of the Hashemite monarchy of Iraq, which had been in power since 1932 and was a close ally of the British. He was one of the seven leading officers that planned and executed the coup on 14 July. In one of several scenarios planned by the Free Officers, al-Shawaf and fellow Free Officer Ahmad Muhammad Yahya were to launch the revolt as their army units returned to Abu Ghraib, near the capital Baghdad, from al-Rutba, in the country's western desert, in early May 1958. Yahya refused to initiate the maneuver, however, and the Baghdad-based Free Officers would not lend support to al-Shawaf. Al-Shawaf was later discouraged from starting the revolt by one of the group's leaders, Abd al-Karim Qasim, who feared any success on al-Shawaf's part would challenge Qasim's future leadership role.
With the success of the 14 July Revolution of 1958, which resulted in the overthrow and killing of King Faisal II and long-time Prime Minister Nuri al-Said, al-Shawaf was to be assigned as Military-Governor General by order of decree. However, due to pressure from leading Free Officer Abd al-Salam Arif, with whom al-Shawaf had differences, al-Shawaf was appointed to the less influential position of garrison commander in the northern city of Mosul on 15 July. He considered this an unjustified demotion by fellow Free Officer and newly inaugurated President Abd al-Karim Qasim, interpreting it as a way keep him distant from Baghdad, the center of Iraqi politics.
According to historian and journalist Said Aburish, al-Shawaf was one of the "minor and least imposing figures" of the Iraqi Revolutionary Command Council (RCC), which administered the country after the revolution. However, the current President of Iraqi Kurdistan, Massoud Barzani, claims that al-Shawaf was "one of the most prominent free officers with democratic leanings."
Tensions increased between Qasim and his communist allies on one side (Qasim was not a communist himself but was an ally of the USSR and saw the communists as a powerful base of support) and United Arab Republic (UAR) President Gamal Abdel Nasser and his Arab nationalist supporters in Iraq, including al-Shawaf, on the other side as the two competed for regional influence. By February 1959 Qasim had imprisoned his rival Arif, a pan-Arabist supporter of Iraqi membership of the UAR, which included Egypt and Syria, and ousted all other pro-unity officers from the RCC. Al-Shawaf saw an opportunity to fill Arif's position in Baghdad, but this was blocked by Qasim, who kept al-Shawaf in his post at Mosul.
The exiled pro-unity officers, who found refuge in the UAR, immediately plotted to overthrow the Qasim government with the help of Nasser and the UAR's Northern Region (Syria) intelligence chief, Abd al-Hamid Sarraj. Al-Shawaf, already disgruntled with Qasim's leadership, was further influenced Iraqi Arab nationalists, including the Ba'ath Party, to move against the president. With Sarraj, al-Shawaf coordinated the smuggling of arms into Mosul from Syria.
Qasim, aware of rising dissent in the Mosul region and attempting to stave off a possible insurrection, permitted the communist Partisans of Peace to hold a mass rally in Mosul and dispatched communist-led Popular Resistance Forces from Baghdad to reinforce the Partisans' numbers. Participants in the rally, who were opponents of pan-Arabism, numbered roughly 100,000. Clashes between them and Mosul-based supporters of Nasser erupted between 5–7 March. The Baghdad-based leader of the coup plot, Colonel Rifaat Haj Sirri, was unable to organize the plan by the time of the disturbances. However, al-Shawaf bypassed Sirri and, having stirred the nationalistic and religious emotions of Mosul's inhabitants, announced the coup against Qasim on 8 March, raising the flag of the UAR over Mosul's citadel. In his announcement, al-Shawaf publicly stated that Qasim had "thrown thousands of innocent citizens into internment camps, the likes of which had never been seen under the rule of the oppressor Nuri Said ..."
Al-Shawaf immediately arrested suspected Qasim loyalists within his Fifth Brigade, as well as a number of civilians believed to be pro-Qasim. The communist leader of the Partisans of Peace, Kamel Kazanji, was also arrested and personally executed by al-Shawaf while in custody. The rebellion received support from some 3,000 fighters from the Shammar tribe, allegedly armed by the UAR, who managed to reach Mosul's suburbs before being pummeled by the Iraqi Air Force. Al-Shawaf also gained support from a number of Kurdish tribes in the Iraqi border regions near Iran and Turkey, but also faced pro-government Kurdish irregulars and armed members of the Partisans of Peace. The following day, on 9 March, al-Shawaf was injured by shrapnel and hospitalized. A non-commissioned officer from his brigade entered his hospital room and shot al-Shawaf dead with his own revolver. Afterward, the revolt appeared to have ended with thousands of Shammar tribesmen being pursued by the Iraqi military to the border with the UAR. Several of al-Shawaf's officers also fled to the country. A massive communist-led campaign to retaliate against pro-Shawaf citizens and soldiers in Mosul immediately followed, and by the end of the hostilities, nearly 2,000–3,000 people were slain.
Relations between the UAR and Iraq, and in turn between nationalists and communists, deteriorated further after the failure of the revolt. During a funeral procession near Saladin's tomb in Damascus for Iraqi officers wounded in the Mosul hostilities who later died in UAR hospitals, placards were raised with the exclamation "Shawwaf, you shall be avenged!" and "Qasim the traitor". Arif, who was imprisoned by Qasim, was honored as a hero of pan-Arabism.