Your result
Portugal — Marriage
Not eligible
This route needs a subsisting marriage at the moment the declaration is made, so a divorce closes it.
The law lets a foreign spouse acquire Portuguese nationality by a declaration made during the marriage. The courts have been clear about the sequence in the applicant's favour on one point — a divorce *after* the declaration does not undo an acquisition — but the declaration has to come first. Once the marriage has ended, there is nothing to declare during.
A legal separation is a harder question than a divorce and worth advice rather than assumption, particularly if the separation is recent or contested.
What is worth checking instead. If you have children of the marriage who are Portuguese, they have their own claims, and if they are minors, their position may affect your immigration status in Portugal even though it does not give you nationality. If you have lived in Portugal, the residence route is unaffected by the divorce: seven years for nationals of Portuguese-speaking countries and of EU states, ten for everyone else, counted from your first residence title. And if you hold a residence permit obtained through the marriage, take advice before it comes up for renewal — the ending of the marriage can affect the basis of the permit, and that is a more urgent problem than nationality.