Mariam died just after midnight after going into shock and efforts to resuscitate her failed.

A sick baby dugong whose fight for recovery won hearts in Thailand and cast a spotlight on ocean conservation has died from an infection exacerbated by bits of plastic lining her stomach, officials said Saturday.

Mariam washed up in shallow waters off southwestern Thailand months ago and photos of her nuzzling playfully next to rescuers quickly went viral.

The discovery soon after of another orphaned dugong brought the sea cows celebrity status, the attention of a Thai princess -- who named the second one "Jamil" -- and round-the-clock webcasts giving viewers a front-row seat to feedings and treatment.

But Mariam died just after midnight after going into shock and efforts to resuscitate her failed, Chaiyapruk Werawong, head of Trang province marine park, told AFP.

"She died from a blood infection and pus in her stomach," he said, adding they found small amounts of plastic waste in her intestinal tract.

An autopsy showed the plastic had caused obstructions in the animal's stomach, leading to inflammation and gas build-up, veterinarian Nantarika Chansue posted on Facebook.

"We could partially treat the respiratory infection but the obstruction of plastic rubbish... could not be cured," she said in the post, calling for her death to serve as a lesson.

"She taught us how to love and then went away as if saying please tell everyone to look after us and conserve her species."

The dugongs are the latest marine creatures to make headlines in Thailand, whose plastic-choked waters are also a threat to habitats.

Both the animals were found in southern Thailand, home to about 250 of the sea cows, which are closely related to the manatee and classified as vulnerable.

Jamil, whose name translates to "handsome sea prince", is being cared for separately in Phuket.

Mariam's death was also announced on the Facebook page of the Department of Marine and Coastal Resources.

The post quickly garnered more than 11,000 shares and thousands of comments mourning the loss, while a meme with a picture of Mariam and "RIP" circulated online.

"It's a pity for those who fed her milk and collected sea grass for their little daughter that we have to lose Mariam because of plastic waste," one commenter said.