UPOLU, Samoa — From the beginning, Nuu Lameko’s baby daughter radiated happiness. She clapped and danced to the songs of praise at church. Often, Ms. Lameko would roll a coconut across the floor of their home to hear her giggle.

“Whenever I’m having a bad day, she would have that smile to cheer me up,” Ms. Lameko said.

Late last month, that joy turned to despair. The baby girl, Lemina — called Mina for short — contracted measles as a calamitous epidemic swept the Pacific island nation of Samoa. Days later, Mina, just 10 months old, died in her mother’s arms.

“I don’t really accept it,” Ms. Lameko said. “God, why? Why my baby?”

That question has consumed Samoa as the epidemic has killed dozens of young children in the past two months and infected thousands more, leaving virtually no one in this nation of big families and communal living untouched.

When measles arrived on its shores, Samoa was grievously unprepared. The government had left the door to contagion wide open, allowing the vaccination rate to fall to a staggeringly low level and putting thousands of children at risk.