Ray Liotta was as polite and courteous as ever when he posed with a fan in the Dominican Republic just days before he passed away — but more importantly … he looked fine.

TMZ has obtained a photo of Ray on Sunday, May 22 — a mere 4 days before he suddenly died in the island nation — and this woman who was fortunate enough to snap a selfie of the two of them says he was as kind and receptive as could be.

Alba tells us she was strolling through BlueMall in Santo Domingo when she caught a glance of Ray walking alongside a couple of handlers as he was headed into a pharmacy.

While RL was inside, Alba walked up to his associates and asked if she could approach … and they gave her the thumbs up. Alba says Ray embraced her, and was super gracious … even praising her on how well she spoke English, given she was a DR native.

Remembering Ray Liotta

Alba would go on to pop the question — asking for a selfie, not his hand in marriage — and Ray didn’t hesitate to say yes! Once Alba was satisfied with her photo, Ray said farewell.

As we reported, Ray died in his sleep Thursday, as he was accompanied by his fiancée in the Dominican Republic filming a movie called "Dangerous Waters." Sources close to the situation tell us Ray was in good spirits and happy to be working … and that there were no signs of health issues leading up to his death. That’s backed by this photo — he looks fairly vibrant.