Short answer. Yes. The distance rule for trees is not limited to trees someone deliberately planted — it also applies to trees which have grown spontaneously. If a tree sits closer to your land than the distance the rule requires, you can demand it be uprooted regardless of how it got there.
What the law says
The provisions of this article also apply to trees which have grown spontaneously
Civil Code, Article 679 — Distances For Planting Trees. Read the full provision →
The rule is not about intent to plant
The distance requirement is written around where a tree ends up relative to the boundary line, not around whether anyone deliberately put it there. The law says plainly that its provisions also apply to trees which have grown spontaneously, so a tree that sprouted on its own — from a dropped seed, a root spreading underground, or simple wind dispersal — is treated the same as one your neighbor planted by hand. The rule binds landowners generally, not just those who consciously chose to plant — a neighbor cannot escape it by claiming the tree simply appeared on its own.
What distance the tree actually has to keep
Absent a local ordinance or custom fixing a different distance, the minimum is at least two meters from the dividing line for tall trees, and at least fifty centimeters for shrubs or small trees. Whether the spontaneous tree in your case counts as a tall tree or a small one determines which of these two minimums applies to it in practice.
Your right to demand it be uprooted
Every landowner has the right to demand that trees planted at a shorter distance than the law allows be uprooted, and because spontaneous growth is expressly covered by the same rule, that right extends to a self-seeded tree encroaching on the required distance. The origin of the tree does not weaken your right to insist it be moved back to where the rule places it, or removed if it cannot be relocated. What the article does not do is give the neighbor a defense based on lack of intent — silence or inaction about a self-seeded tree does not excuse the encroachment once you raise it.
Check local ordinances first
Before relying on the two-meter and fifty-centimeter figures, check whether your locality has its own ordinance or established custom on planting distances — the statute defers to those first, and the general figures apply only in the absence thereof. A local rule could set a different distance than the general one, so it is worth confirming which distance actually governs your particular property before pressing the demand.