LOS ANGELES — It was a dramatic engagement photo that quickly went viral.

With the sun setting over Yosemite National Park, a man got to his knees and proposed to his girlfriend at Taft Point, a rock outcropping perched precariously over the valley.

But then another man and woman hiked to the top but then plunged to their deaths. Their bodies were found Thursday about 800 feet below the popular hiking destination.

The National Park Service is investigating how the pair fell. But the incident has reignited concern about the risk people take in parks such as Yosemite, where the picturesque vistas are perfect for Instagram or Facebook but can hide the dangers.

On Instagram, posts from visitors climbing to the top of Taft Point show hikers leaping in the air and sitting with their legs dangling off the side of the cliff. There are couples embracing against a sunset backdrop and even exchanging vows in suits and flowing ivory gowns.

Earlier this year, a teenager visiting Yosemite from Jerusalem lost his balance and plunged to his death while reportedly trying to take a selfie at Nevada Fall, a nearly 600-foot-high waterfall on the Merced River.

Divided attention and unfamiliarity with the topography have long played a role in fatal falls at Yosemite and other wilderness parks. But experts said social media has added another element to the mix, with the overwhelming desire to chronicle the beauty of the environment sometimes making visitors more careless.

"Winning the prize sometimes is psychologically more important than the peril of that prize," said Michael Ghiglieri, who co-authored 2007's "Off the Wall: Death in Yosemite."

Yosemite is one of the most photographed places in the world, and the familiarity of those images can lead visitors to a false sense of security.

"A lot of people when they're in a place like Yosemite where there's spectacular danger, they can't just be there, they have to brag about it," Ghiglieri said. "This idea enters like a Grim Reaper with a camera," he said.

Ghiglieri and others said danger looms at Taft Point and other areas of the national park where people can walk to the edge of cliffs and waterfalls sans railings to capture the perfect, enviable shot.

One website produced safety tips for taking selfies at Yosemite.

The "bad selfies" list by MyYosemitePark.com advises against posing near waterfalls, wildlife and rivers. It also reminds visitors to always hold the cables while climbing Half Dome.

But there are limits to how safe park officials can make these majestic outdoor spaces.

Grand Canyon National Park spokeswoman Kari Cobb said the park won't install a permanent structure such as a guard rail because it would compromise the natural integrity of the landscape.

Instead, officials dispatch more rangers along trails where accidents are most common and post safety messages and warnings on maps and at trail heads, she said.

"Ultimately, visitors are accepting an inherent risk when they come and hike here," Cobb said.

At Grand Canyon, two or three people fall to their death each year on average. About 6.3 million people visited Grand Canyon's vast expanse in 2017.

At least 10 people have died in Yosemite this year, six of them from falls and the others for reasons including medical conditions to lack of water. That number appears to be trending in line with recent years in which the park has seen 13 to 20 fatalities annually. Yosemite welcomed about 4.3 million visitors last year.

By Ghiglieri's count, there have been 1,002 traumatic deaths — with more than 300 attributed to falls — at Yosemite since the 1800s.

This experience isn't exclusive to national park visitors. A hankering among local hikers to rack up "likes" and shares on Instagram and other social media sites has led to a significant increase in rescue missions by first responders in the Angeles National Forest.

The Los Angeles County Sheriff's Department's search and rescue teams conducted 681 missions in 2017, the largest number in five years.

Ghiglieri said places such as Yosemite have always posed danger to humans. But the smartphone camera adds a different element.

"The big payoff is at war with the normal level of caution we're born with," he said.