Does permanent residency in Spain equal free public healthcare?

Permanent or long-term residency gives non-EU nationals in Spain extended rights, but does it also give foreigners access to public healthcare even if they’re not contributing to the country’s social security pot?

Does permanent residency in Spain equal free public healthcare?
Permanent or long-term residency gives non-EU nationals in Spain extended rights, but does it also give foreigners access to public healthcare even if they’re not contributing to the country’s social security pot?