The Facebook logo is shown at Facebook headquarters in Palo Alto
A Facebook user was electrocuted after he uploaded a photo to his profile REUTERS

A Facebook user was electrocuted by power lines as he took a photo of a sunset.

David Strohm had climbed a tree in his garden for a better vantage point to photograph an evening sunset for posting on his Facebook page.

But while the 28-year-old was up the tree he is believed to have touched a highly charged cable and was electrocuted.

His family spent the night searching for him but it was not until the next morning that his body was discovered - still in the tree.

Orange County fire service spokesman Steve Concialdi said the incident emphasised just how dangerous contact with a power line could be.

"This is not a freak thing. If you touch an electrical line you can be electrocuted and you can lose your life," he said.

"Stay away from electrical lines at all times. Do not be curious. Stay away from it even if you think it's a cable line."