I almost paid 180,000 dirhams in capital gains tax on a property sale I didn’t need to pay at all.
Not because I was doing anything wrong. I just didn’t know the exemptions existed. My notary mentioned the tax, I panicked, and I nearly wrote the check before a friend who works in real estate law stopped me and said: “Wait. Did you check if you qualify for the exemption?”
That conversation saved me a lot of money. And it’s why I’m writing this.
If you’re planning to sell property in Morocco and want to legally reduce or avoid TPI tax on that sale, this guide covers the key exemptions — especially the 6-year principal residence rule — along with the mistakes sellers make and the strategies that actually work.
Your exact situation matters. Always verify with a notary or tax professional before relying on any exemption.
At a Glance: Morocco TPI Exemption
- TPI (Taxe sur les Plus-Values Immobilières) is the main tax sellers face in Morocco when selling a property at a profit.
- A full exemption may apply if the property was used as your principal and habitual residence for at least 6 continuous years.
- The exemption is not automatic — you must be able to demonstrate that the property was genuinely your main home.
- Documentary proof of principal residence is essential: utility bills, official address records, and evidence of continuous occupation.
- Foreigners living in Morocco may qualify for the exemption, but should verify their specific eligibility before assuming it applies.
- Do not rely on this exemption until a qualified notary or tax professional has confirmed it applies to your case.
- Other reductions may also reduce or eliminate your TPI: a low-gain threshold and a degressive rate for long-term holders.
Morocco TPI Exemption: The 6-Year Principal Residence Rule
This is the exemption most sellers either don’t know about or don’t know how to claim.
Under Article 63 of the Moroccan Code Général des Impôts (CGI), if you sell a property that has been your principal and habitual residence for at least 6 continuous years, you may be fully exempt from TPI, meaning zero capital gains tax on the sale.
This is not a loophole. It is written into Moroccan tax law. But the exemption is not automatic, and it is not something you can assume without verification.
What “principal residence” means in practice
The Moroccan tax authority (Direction Générale des Impôts, or DGI) will look at whether the property was genuinely your main home , not a holiday property, not a rental investment, not a secondary address you visited occasionally.
Documents that can help demonstrate principal residence include:
- Utility bills (electricity, water, gas) in your name at that address, covering the relevant years
- Your official registered address on a national ID, residence card, or carte de séjour
- Bank and government correspondence sent to that property address
- A letter from the syndic or building management confirming your occupation
- Evidence of continuous rather than seasonal or intermittent use
The stronger and more consistent your paper trail, the cleaner the exemption claim.
Can foreigners qualify for the Morocco TPI exemption?
In principle, yes. The 6-year principal residence rule is not restricted to Moroccan nationals. A foreign resident who has genuinely used the property as their main home for at least 6 continuous years may qualify for the same exemption.
However, foreigners should be especially careful. If you split time between Morocco and another country, the DGI may question whether Morocco was truly your principal residence. Having stronger documentation for your Moroccan address than for any other is important.
Do not rely on this exemption before speaking to a notary or tax professional who knows your full circumstances. Your situation matters more than a general rule.
What the 6-year rule does not cover
If the property was primarily used as a rental investment, a holiday home, or a secondary residence, the principal residence exemption will not apply — even if you stayed there from time to time.
In those cases, other reductions may still help. The low-gain threshold and the degressive long-hold reduction are both explained below.
What Tax Are We Actually Talking About?
Before anything else, let’s be clear on what you’re dealing with.
When you sell a property in Morocco and make a profit, you owe what’s called the Taxe sur les Plus-Values Immobilières, commonly known as TPI. This is the capital gains tax on the profit you made from the sale.
The standard rate is 20% of your net capital gain.
But here’s the catch most people miss: even if your calculation shows zero gain, the Moroccan tax authority (DGI) applies a minimum tax of 3% of the gross sale price.
So if you sell a property for 1,000,000 dirhams, you owe at least 30,000 MAD — even if you didn’t technically profit.
That minimum rule surprises a lot of sellers. Knowing it exists is the first step. Knowing how to avoid it legally is the second.
How the Capital Gain Is Actually Calculated
This part matters because the formula is more favourable than most people think.
Your taxable gain is not simply the difference between what you paid and what you sold for.
Morocco allows you to adjust your purchase price upward using an annual revaluation coefficient set by the government. This adjusts for inflation and significantly reduces your apparent gain.
Here is how the net gain is calculated:
Net Gain = Sale Price – (Adjusted Purchase Price + Eligible Expenses)
Eligible expenses you can deduct include:
- Notary fees from when you originally bought
- Registration and stamp duties paid on purchase
- Major renovation or improvement costs (with receipts)
- Real estate agent commission on the sale (if applicable)
I learned this the hard way when I first tried to calculate my own liability. I used the raw purchase price and panicked. When I factored in the revaluation coefficient and all the original fees I paid, my taxable gain dropped by nearly 40%.
Always do the full calculation. Never estimate.
The Main Exemption: How to Avoid TPI Tax in Morocco Legally
This is the big one. And it is completely legal.
The Principal Residence Exemption (6-Year Rule)
If the property you are selling has been your principal and habitual residence for at least 6 continuous years, you pay zero capital gains tax on the sale.
Zero. Full exemption.
This is not a loophole. It is written directly into the Moroccan tax code under Article 63 of the Code Général des Impôts (CGI). This is the Morocco TPI exemption most sellers either overlook or don’t know how to claim properly.
To qualify, you need to prove the property was your main home. The DGI looks at things like:
- Your registered address on official documents
- Utility bills in your name at that address
- Your residence status with local authorities
- Proof of continuous occupation
If you have been living in the property and have the paper trail to show it, this exemption is yours to claim — but verify it with your notary before the sale. Do not assume it applies without confirmation.
I used this exemption myself. I had been living in my apartment in Casablanca for seven years. When I sold, I brought my utility bills, my residence card showing that address, and a letter from the syndic. The notary processed the sale with zero TPI.
It felt too easy after all that worry.
The Exemption for Low-Value Gains
If your net capital gain is 140,000 dirhams or less, you are also fully exempt from TPI on a property sale in Morocco.
This threshold catches a lot of people who bought modestly and sold modestly. If you bought a small apartment in a secondary city for 600,000 MAD years ago and sold it for 720,000 MAD, after deductions and revaluation, your gain may well fall under that threshold.
Always calculate before assuming you owe anything.
The Long-Hold Reduction (Degressive Rate After Year 10)
Even if you don’t qualify for a full exemption, Morocco rewards long-term property holders with a sliding scale reduction on the taxable gain.
Here’s how it works:
- Years 1 to 5: No reduction, full 20% rate applies
- Year 6: 8% reduction on the gain
- Year 7: 16% reduction
- Year 8: 24% reduction
- Year 9: 32% reduction
- Year 10: 40% reduction
- Years 11 and beyond: Increases by 8% per additional year
So if you’ve held a property for 15 years and don’t qualify for the principal residence exemption, you may still benefit from a significant reduction in your TPI liability.
This is the strategy many investors use without realising it. Patience is genuinely rewarded in Moroccan tax law.
How to Avoid TPI Tax in Morocco: Practical Steps
Here is what I actually did and what I recommend:
Step 1: Gather your original purchase documents
Pull out your original notarial deed (acte notarié). You need the exact date of purchase and the exact price paid. Every dirham matters in the calculation.
Step 2: Collect all expense receipts
Find receipts for registration fees, notary fees, and any major works done on the property. Receipts from licensed contractors carry more weight. Informal work is difficult to deduct.
Step 3: Calculate your adjusted purchase price
Ask your notary or a tax advisor to apply the correct annual revaluation coefficient for each year you held the property. This is published annually by the DGI.
Step 4: Determine which exemption applies to you
Go through the three scenarios: principal residence for 6+ years, gain under 140,000 MAD, or long-hold reduction. One or more may apply. You should verify this with a notary or tax professional before proceeding, your exact situation matters.
Step 5: Prepare your supporting documentation
If you’re claiming the Morocco TPI exemption through the principal residence rule, gather utility bills, your official registered address history, and any other evidence of habitual occupation.
Step 6: Work with a qualified notary from the start
In Morocco, all property sales must go through a notary. But not all notaries are equally thorough on the tax side. Find one who is experienced with TPI calculations and will take the time to check your exemption eligibility.
Common Mistakes That Cost Sellers Money
Assuming you owe the maximum rate without calculating
Most people hear “20% capital gains tax” and immediately assume the worst. The actual taxable amount, after deductions and revaluation, is almost always lower. Sometimes it’s zero.
Not keeping original purchase receipts
If you lost your original acte notarié or don’t have receipts for renovations, you lose deductions. Keep every piece of paper from the moment you buy.
Confusing rental income tax with capital gains tax
These are two completely separate things. If you rented the property before selling, that rental income is taxed differently under the Impôt sur le Revenu. Don’t mix them up.
Selling in a rush without checking the calendar
If you’re at year 5 of ownership and considering selling, waiting 12 more months triggers the degressive reduction and could save you meaningfully. If you’re approaching the 6-year mark, that matters even more — crossing it could mean full TPI exemption rather than a partial reduction. Many sellers don’t check this.
Relying on informal advice
I’ve met sellers who asked a neighbour, a cousin who once bought a property, or someone at a café. Tax law in Morocco is specific and it changes. Only use a certified notary or a chartered accountant (expert comptable) who knows property tax.
Realistic Costs to Expect When Selling Property in Morocco
Even with the TPI exemption, selling has costs. Here’s what to expect:
| Cost | Approximate Rate |
|---|---|
| Notary fees | 1% to 1.5% of sale price |
| Registration fees | Usually handled by buyer, but verify |
| Real estate agent commission | 2% to 5% of sale price |
| Capital gains tax (TPI) | 20% of net gain, minimum 3% of sale price (unless exempt) |
| Urban land tax (TPI local) | May apply depending on property type |
If you qualify for a full TPI exemption, your main selling cost is the notary fee and agent commission. That’s still 3% to 6.5% of the sale price, so factor it in.
What Foreign Residents Need to Know
This is an area where the rules get more specific and where mistakes get expensive.
If you are a non-resident Moroccan or a foreign national, the TPI rules still apply to you. But there are additional layers:
Currency repatriation rules: If you bought the property using foreign currency brought into Morocco, you can repatriate the proceeds. But you need documentation proving the original transfer, usually a bank attestation of the original currency import.
Double taxation treaties: Morocco has tax treaties with many countries including France, Spain, the UK, and others. Depending on your country of residence, you may be taxed there instead of in Morocco, or the Moroccan tax paid may be creditable. This is something to check with a tax advisor in both countries before you sell.
Non-resident withholding: If you’re not resident in Morocco, the buyer’s notary may be required to withhold a portion of the sale price for tax purposes. This is adjusted later based on actual tax liability.
Don’t assume your home country’s rules apply in Morocco. They don’t.
Insider Tips Most Articles Miss
Tip 1: The “date of acquisition” is not always when you signed
In some cases, especially with inherited property or off-plan purchases, the legal acquisition date may differ from what you expect. This affects both your holding period and your revaluation calculation — including whether you’ve cleared the 6-year mark for the principal residence exemption. Confirm the legal date with your notary.
Tip 2: Jointly owned property is calculated per owner
If you co-own a property with a spouse or partner, each owner’s share is taxed separately. In some situations this creates a lower effective rate, especially if one owner qualifies for the 140,000 MAD threshold individually.
Tip 3: Declare expenses proactively, even small ones
Even modest renovation costs add up and reduce your gain. A bathroom renovation in 2018, a new roof in 2020, updated electrical wiring. Every documented cost works in your favour. Don’t assume something is too small to mention.
Tip 4: The timing of your sale within the year matters
The DGI calculates holding years from acquisition to the date of the notarised sale. Selling in February vs. October of the same year can mean crossing a threshold that changes your degressive reduction bracket — or crossing the 6-year mark for the Morocco TPI exemption entirely. Check the calendar before finalising your sale date.
Tip 5: Request a pre-calculation from the DGI
This is something very few sellers know. You can approach your local tax office and request a preliminary assessment of your expected TPI liability before the sale. It’s not binding, but it gives you a realistic number to plan around and flags any issues early.
How to Avoid TPI Tax in Morocco: Who This Strategy Works For
To be direct, the full TPI exemption via the principal residence rule works best if:
- You have genuinely lived in the property as your main home
- You have the documentation to prove it
- You’ve been there for at least 6 continuous years
If you’re an investor who rented the property out the whole time, you likely won’t qualify for that exemption. But you may still benefit significantly from the long-hold degressive reduction and from thorough expense deduction.
The goal is always to start with an accurate calculation. From there, apply every legal deduction and exemption that applies to your situation.
This is not about being aggressive with tax planning. It is about not overpaying because you didn’t know the rules.
Conclusion
Selling property in Morocco without understanding TPI is like playing a card game without looking at your hand. You might still win, but you’re leaving things to chance.
The principal residence exemption, the low-gain threshold, and the long-hold reduction are all legitimate tools the Moroccan tax code offers you. Using them is not avoidance in any questionable sense. It is simply knowing what you’re entitled to.
Work with a qualified notary. Keep your documents. Calculate before you assume. And if you’re approaching a meaningful threshold — like the 6-year mark for the principal residence exemption or a gain near 140,000 MAD — time the sale deliberately.
The money you save isn’t found money. It was always yours.
Frequently Asked Questions
What is the 6-year principal residence rule in Morocco?
Under Article 63 of the Moroccan Code Général des Impôts, if you have used a property as your principal and habitual residence for at least 6 continuous years, you may be fully exempt from TPI when you sell. The exemption is not automatic — you must be able to demonstrate that the property was genuinely your main home, and the claim should be confirmed by a notary before you rely on it.
Can foreigners qualify for the TPI exemption in Morocco?
In principle, yes. The Morocco TPI exemption is not restricted to Moroccan nationals. A foreign resident who has genuinely used the property as their principal residence for 6 or more continuous years may qualify. However, if you split time between countries, the DGI will assess whether Morocco was truly your primary home. Verify your specific eligibility with a notary or tax professional before assuming the exemption applies to you.
What documents can prove principal residence in Morocco?
Useful documents include: utility bills (electricity, water, gas) in your name at the property address covering the relevant years; your official registered address on a residence card, carte de séjour, or national ID; bank and government correspondence sent to that address; and a letter from the syndic or building management confirming your occupation. The more consistent and complete your documentation across those 6 years, the stronger your position.
Is TPI the same as capital gains tax in Morocco?
Yes. TPI stands for Taxe sur les Plus-Values Immobilières, which is Morocco’s property capital gains tax. It applies to the profit made when selling real estate. The standard rate is 20% of the net taxable gain, with a minimum floor of 3% of the gross sale price even when no gain is made — unless a full exemption applies.
Should I rely on the TPI exemption before speaking to a notary?
No. Do not rely on any exemption — including the 6-year rule — until a qualified notary or tax professional has reviewed your situation and confirmed it applies. Eligibility depends on your specific circumstances: how long you’ve actually lived there, what documentation you hold, your residency status, and how the DGI is likely to assess your case. Get confirmation before you proceed.
Do I have to pay capital gains tax in Morocco if I sell at a loss?
If you sell for less than you paid (after adjustments), you have no taxable gain. However, the 3% minimum tax on the gross sale price still applies unless you qualify for a full exemption.
Can I avoid TPI by selling to a family member?
No. The tax applies to any sale regardless of who the buyer is. Selling below market value to a family member can also trigger scrutiny from the DGI.
What happens if I don’t declare the sale?
All property sales in Morocco go through a notary and are automatically reported to the DGI. There is no way to hide a sale. Attempting to underreport the sale price carries serious legal and financial penalties.
Does the 6-year rule reset if I renovate or extend the property?
No. The 6-year clock runs from your original acquisition date, not from any renovation date.
I inherited a property in Morocco. How is my holding period calculated for TPI purposes?
For inherited property, the acquisition date is generally the date of death of the person you inherited from, not the date the inheritance was formally transferred to you. This can significantly extend your effective holding period.
Can I claim the principal residence exemption if I split time between Morocco and abroad?
This is a grey area. The property must be your principal and habitual residence. If you split time fairly evenly, the DGI may scrutinise your claim. Having stronger documentation for Morocco than for your other location helps. A tax advisor’s guidance is worth it here.
Is there any tax benefit to selling through a company rather than personally?
Yes, but it introduces significant complexity. Corporate property disposals are taxed under corporate income tax rules, not TPI. Whether this is advantageous depends heavily on your specific structure, profit level, and situation. Do not structure a sale through a company without professional advice.
Anis is the founder of Buy Property Morocco, a research-based resource created to help foreign buyers understand the real process of buying property in Morocco safely.
He focuses on the practical details most buyers only discover too late: title deed checks, notary steps, compromis de vente risks, transfer taxes, foreign banking rules, repatriating money after a sale, and avoiding common mistakes when dealing with agents or sellers.
Anis has personally bought 4 properties in Morocco and shares practical guidance based on real experience, not theory.
If you are seriously considering buying property in Morocco and want private guidance before you send money, pay a deposit, or sign anything, you can book a buyer safety call here:



