It's Moroccan or Algerian, probably 19th century. These guns kept many obsolete features derived from earlier European guns. According to Elgood, this one should represent style from the Tetuan N Coast, N of Fez on plains below Atlas Mts
From Elgood, Firearms of the Islamic World:
P67-68 – The Maghrib had close links to Europe, espec Spain – N Africa conquered by Arabs, also included those expelled from Spain, and Portuguese, Spanish, Dutch trade colonies dominated coast and some inland trade routes, bringing much Euro influence in arms. So p69-70, Moroccan guns of 19th C still show “fishtail” stock “which closely resembles the Dutch matchlock musket of about 1680” and “local variations on the Anglo-Dutch snaphaunce lock of the 1600s were still in production in the nineteenth century.” Butt wood was walnut from Goundafa, silver decoration from Spanish coins, camel bone or ivory from Sudan. “All artisans had their own particular type of decoration which was easily recognizable by those who know them.”
Tirri, Islamic Weapons: p 20 – generic ‘Berber guns’ but 4 regional variants of Moroccan identifiable. All generally called Mukahla.
1. Tetuan region N of Fez – wood stocked smoothbores w inlaid decoration [Fig 2, Moroccan ‘Mukahla’ from Tetuan N Coastal region, – sim to my M#1 in butt + lock form, delicate decoration, but with wire. P36 fig 15 ‘Berber’ guns include another with stock form + décor sim to mine, from Algeria.]
2. Taroudant region – sim to other Berber guns, but more conventional buttstock design, long barreled smoothbores, called Affedali [fig 3 shows straighter butt, w thumb notch, bone plate decoration]
3. above the Little Atlas Mts, called Altit, sim in décor to Affedali, but distinctive downturned camel bone or ivory butt. [This is my M #2 – fig 4 shows one example so similar to mine that it must have been made by same shop or same craftsman.]
4. Ras el Oued region, high valley of the Sous Mts, called Taouzilt, butt covered with silver plates, mesh, and studs. [fig 5 shows straight butt with thumb notch, shape like Affedali, décor rather ugly in my opinion]