The most likely cause is post-inflammatory hyperpigmentation. The prior red spots suggest some form of skin inflammation.
When skin inflammation occurs, the skin's pigment forming cells (melanocytes) produce excessive pigment (melanin). This excess pigment "drops" to the lower layers of the skin (dermis) and are engulfed by the skin's scavenger cells (melanophages).
Scratching and sun exposure tend to make the pigmentation worse. As the pigment is located in the deeper layer of the skin, its clearance will be slow and gradual, often taking many months to fade away.
Topical lightening creams and laser treatment may help the pigmentation clear faster but the response may be variable. If the red spots reappear, it may be best for you to consult your doctor to determine the cause and to prevent further pigmentation from forming.