What is the origin of acequia?

Acequia “irrigation ditch” is a borrowing of a Spanish term derived from Arabic as-sāqiyah, an assimilated form of al-sāqiyah “the irrigation ditch.” Al- is the Arabic equivalent of the article the, and a special feature of al- is that it assimilates to match the first consonant of the word that follows under certain circumstances. The l sound is pronounced with the tip of the tongue, and when the word that follows al- begins with a similarly pronounced consonant (such as d, n, or s), the l in al- changes to match. In Arabic words that were adopted by Portuguese or Spanish and then adopted into English, the al- article exists today, albeit in disguise merely as a-, in words such as acequia, adobe, and even tuna (a corruption of Spanish atún). However, the full al- form is still visible in words that did not start with a tip-of-the-tongue consonant, such as albacore, alcohol, alcove, and alfalfa. Acequia was first recorded in English circa 1840.