In 2008 the Royal Moroccan Air Force ordered a total of 24 F-16s. They are meant to reinforce the existing F-5s and Mirage F-1s in the inventory. Together with this order, a complete warfare suite was also negotiated.
Back in 1991, Morocco had an urgent requirement to replace its F-5E/F fleet and supplant its depleted Mirage F-1CH/EH force. Especially when Algeria decided to purchase up to 100 MiG-29s to replace all their elderly MiG-21s and MiG-23s.
Morocco had been funded by Saudi Arabia and the UAE for the purpose of purchasing 20 ex-USAF F-16A/B. A contract with the US government was signed in November of that year. However, the Moroccan government was also looking at the Mirage 2000 which was also boosted by SAGEM's agreement to upgrade Morocco's Mirage F-1CH/EH. Both deals never came through though.
In 2007, the Moroccan government started another round of negotiations to purchase a new fighter for its air force. The trigger to this was the fact that neighbour Algeria had purchased another batch of 30 Mig-29SMT and a new order for 28 Su-30MKA.
It seemed for some time that the Dassault Rafale would gain its first export success. An offer was made for 18 Rafales at a cost of 3.3bln USD. The US countered this offer by stating it would deliver up to 36 second-hand F-16s at a cost of only 1.4bln USD. France desperately tried to gain this contract by providing either 12 Rafales and 12 Mirage 2000 aircraft, or 24 Rafales for 2.85bln USD. However, the exchange rate between USD and euro in 2008 is way more in favor of the USD, making the F-16 purchase a real bargain in comparison with the Rafale.
After negotiations with the US government, the Royal Moroccan Air Force was granted to order up to 24 new block 52 F-16s to reinforce the F-5 and Mirage F-1 fighters, at a total program cost of up to 2.4bln USD.