Tax offsetting in a writ of mandamus: understanding the STF ruling in Theme 1500

2026-11-26

By the Cathedra Iuris Editorial Team

Brazil's Supremo Tribunal Federal (STF) [Federal Supreme Court] has decided that it will not have the final say on whether taxpayers can use a writ of mandamus (mandado de segurança) to offset taxes paid unduly before the writ was filed. In Theme 1500 of general repercussion (RE 1.617.746/PR), the Virtual Plenary held, by 6 votes to 4, that the dispute is a matter of statutory, not constitutional, law. As a result, the position of the Superior Tribunal de Justiça (STJ) [Superior Court of Justice] prevails: a taxpayer may use the writ to obtain a declaration of the right to offset amounts paid in the five years before filing.

The facts: Paraná's appeal and Theme 1500

The case arose from a collective writ of mandamus filed by a business association in the state of Paraná on behalf of its members, concerning ICMS [state tax on the circulation of goods and services]. The Paraná Court of Justice recognized the members' right to seek administrative offsetting or refund of amounts overpaid in the five years before the lawsuit. The State of Paraná appealed to the STF.

The mandado de segurança is a constitutional action that protects a clear and certain right against an unlawful act by a public authority (art. 5, LXIX and LXX, of the Constitution). In tax matters it is widely used to block assessments and to declare the right to offsetting (compensação), which is the setting off of the taxpayer's credit against its own tax debts. STJ Precedent 213 states that the writ of mandamus is an appropriate action to declare the right to tax offsetting.

The underlying debate involved two long-standing STF precedents. Precedent 269 says that the writ does not replace a collection action, and Precedent 271 provides that granting the writ produces no financial effects for past periods. The State argued that allowing the offset of amounts paid before the writ was filed would give the writ effects it cannot have.

What the STF decided

General repercussion is the filter that allows the STF to hear only extraordinary appeals raising a constitutional question that matters beyond the specific case. When the Court finds that a matter lacks general repercussion, extraordinary appeals on the same issue are dismissed by the lower courts (arts. 1.030, I, "a", and 1.035, § 8, of the Code of Civil Procedure).

The rapporteur, Justice Dias Toffoli, separated two situations that are often treated together:

  • Cash refund. When the overpayment is recognized in court, repayment must follow the court-ordered payment system (precatórios) of art. 100 of the Constitution, under the thesis of Theme 1262. On this point the State's appeal was partly upheld, and direct administrative refund was ruled out.
  • Offsetting. No public money leaves the treasury: the tax debt is extinguished by setting the accounts against each other. For that reason, offsetting is not subject to the precatório system. It is governed by the National Tax Code (CTN) and by the laws of each federative entity, which makes it a statutory matter.

Justices André Mendonça, Edson Fachin, Flávio Dino, Nunes Marques and Cármen Lúcia joined the rapporteur. Justices Alexandre de Moraes, Luiz Fux, Cristiano Zanin and Gilmar Mendes dissented, holding that the issue concerns the constitutional scope of the writ of mandamus and its relationship with the precatório system.

Because the merits were not decided, the STF did not set a thesis on the right to offsetting itself. The practical effect is that STJ case law remains the reference. In EREsp 1.770.495/RS, decided in 2021, the STJ's First Section held that a writ that only declares the right to offset has prospective effects, because the offsetting takes place later, at the administrative level, and therefore does not conflict with Precedent 271. Filing the writ interrupts the limitation period, and the taxpayer may use undue payments made in the five years before filing.

Practical impact

For taxpayers

The writ of mandamus remains an appropriate way to seek a declaration of the right to offset payments from the last five years. It has no evidentiary phase and does not lead to an award of attorney fees against the losing party (art. 25 of Law 12.016/2009), which lowers litigation costs compared with an ordinary action for repayment of undue taxes.

The decision does not turn the writ into a means of obtaining a cash refund. Anyone seeking to recover amounts recognized in court in cash remains subject to the precatório system.

For tax authorities and the courts

Extraordinary appeals on the same point are likely to be stopped in the lower courts, which leaves the dispute with the STJ. Offsetting remains subject to the rules of the CTN:

  • art. 170 requires a law of the taxing entity authorizing offsetting and setting its conditions;
  • art. 170-A bars offsetting before the court decision recognizing the disputed credit becomes final;
  • art. 166 makes the recovery of indirect taxes, such as ICMS, conditional on proof that the taxpayer bore the financial burden or was authorized by whoever bore it.

At the federal level, offsetting is governed by art. 74 of Law 9.430/1996. In states and municipalities the situation varies, and the practical effect of a court declaration depends on whether a local law exists.

Open questions

The STF has yet to decide motions for divergence (embargos de divergência) in ARE 1.525.254. In that case the Second Panel extended the reasoning of Theme 1262 to offsetting, a position different from the one adopted in Theme 1500. The motions concern the offsetting of ICMS paid before the writ was filed, and the outcome may show whether the Court keeps a single line on the subject.

There is also the question of entities that have not enacted an offsetting law. In those cases the taxpayer obtains a declaration of the right but may face obstacles in exercising it administratively. Finally, applying art. 166 of the CTN to indirect taxes still requires case-by-case proof, which may limit the practical reach of decisions obtained in collective writs.

Conclusion

In Theme 1500, the STF held that the offsetting of taxes paid before a writ of mandamus is filed is a statutory matter and left its regulation to the STJ. Cash refunds of amounts recognized in court remain subject to precatórios. Offsetting follows the CTN, the law of each entity and the case law set in EREsp 1.770.495/RS.

Sources

Cathedra Iuris accepts articles from every field of Law on a continuous basis, with no fees. See the author guidelines or read the published articles.

This content is published by Cathedra Iuris: Revista Científica de Direito (ISSN 3086-7444), cathedraiuris.org, under the Creative Commons Attribution 4.0 International (CC BY 4.0) license. You may share and adapt it, provided the source is credited.