Well, this is half sell and half "how to buy a car," because I'm discussing the paperwork parts, which overlap a bit.
First, work out the details with the seller and pay for the vehicle. I'll leave that part open.
After that, go to a local stationery shop and buy a "carte gris" transfer paper, the application needed to apply for new ownership papers.
Next, go to the technical inspection station for a "Visite Technique," or a full inspection of the vehicle to make sure it is in working order. Pay your fee (290 Dirhams yesterday, just over $40). Get your paper signed, the proper rubber stamps applied, and make sure you keep your receipt. This takes about an hour.
Now, it is time to go to the muqtaa, or notary public. You sign the paper in his presence, after waiting about 45 minutes. He will look at your Moroccan residence cards, for both the seller and buyer, both of whom must be presetn, then at the form. He will check the signatures on the paper, then enter your information in a book and have you both sign in the book. Then, he will use at least four different rubber stamps on your paper, along with 4 tax stamps that look similar to postage stamps, and sign the paper.
From this point on, only the buyer needs to be present. The seller is done. I continued through the process yesterday with a friend who just bought my car to help with the Arabic.
Now you are ready to go to the oversight office to pay the taxes. You will need your old carte gris, or ownership papers, along with the original receipt for last year's vignette, or window sticker, and more money (204 Dirhams, about $30). Give the man your paper and wait about 30 minutes. Receive it back with a new sticker on it, some more rubber stamps, and a new signature.
When that is done, take the paper, the same one from the beginning, and go to yet another government office. None of these are within walking distance from one another. Here, you will be sent out for a new paper that was not previously required. We went outside and across the street to pick up a form and pay a small fee. Return and give that form, along with some money, the old carte gris, a notarized copy of the new owner's residence card, and probably something else that I have forgotten, to the man. He will accept your payment of fees (sorry, I didn't notice how much) and give you a receipt that will be good for two months until your final ownership papers are ready.
Is that all? No.
Then, you must go to an insurance agent immediately and make sure the vehicle is insured in the name of the new owner, because it is illegal to drive on the roads otherwise.
Then, in two months, you return to the last office to pick up your ownership papers. Sometimes they are ready, usually they are not. In that case, you return a month later, then another month later, finally to be told you were missing a date next to one of the rubber stamps and a signature that you can't read and you have to go back to that office and get it put in, or worse yet, replace the form entirely.
If all goes as usual, you should legally own the car in anywhere from two to six months, although I have seen it take as long as nine.