An endangered loggerhead sea turtle suffered a painful ordeal on a beach in Lebanon last week, when people allegedly dragged it out of the surf, stepped on it to take selfies, and then beat it with sticks.

Suffering serious injuries, including cracked bones on its head, the female turtle was rescued by the nonprofit Greenarea and is being rehabilitated by the charity group Animals Lebanon.

Animals Lebanon is working with the country's Ministry of Agriculture and Civil Defense to "make sure this sea turtle does not die from this unnecessary, avoidable, and illegal cruelty," the group writes on its website. (Learn about the straw removed from a sea turtle's nose.)

WATCH: An endangered sea turtle is recovering after allegedly being beaten by people who were taking selfies with it on a beach near Beirut, Lebanon. Footage courtesy Animals Lebanon.

Harassment of the animal reportedly took place at Havana Beach in Beirut. After someone allegedly dragged it onto the beach from the water, a crowd gathered around it. A child stood on the turtle's back while people snapped photos.

A witness said people then beat it with a stick.

View Images The turtle is rescued after people attacked it in Beirut. Photograph by Jason Mier, Animals Lebanon

At the Animals Lebanon facility, the turtle is being treated with antibiotics and has received x-rays.

"The damage is visible and evident—the blows and trauma she suffered have broken through the top of her head, and water from the sea has reached her sinus cavities," the group writes.

The charity is working with vets to help the turtle recover. Without help, the injuries had a good chance of being fatal. (Learn about the death of a bison calf in Yellowstone after tourists picked it up.)

Loggerhead sea turtles (Caretta caretta) are endangered. Persistent population declines due to pollution, shrimp trawling, and development in their nesting areas, among other factors, have kept this wide-ranging seagoer on the threatened species list since 1978.

Over the past few years, activists have worked to protect nesting sites on southern Lebanon beaches from development, sometimes clashing with local government.

The largest of all hard-shelled turtles, loggerheads have massive heads, strong jaws, and a reddish-brown shell, or carapace. Adult males reach about three feet (nearly one meter) in shell length and weigh about 250 pounds (113 kilograms), but large specimens of 1,000 pounds (454 kilograms) have been found.

View Images The turtle's head shows injuries where it was struck. Photograph by Jason Mier, Animals Lebanon

View Images The animal's injuries were life threatening. Photograph by Jason Mier, Animals Lebanon

The turtles range around the world, in all but very cold water. They primarily eat fish and invertebrates, with some seagrasses. Starting around age 25, mature females often return to the beach where they hatched to lay their eggs, often traveling thousands of miles.

Such incidents raise questions about humans' relationship to other living things, particularly in an era of selfies and social media.

This story was updated at 9:50 am ET June 27 to include mention of Greenarea.