Mark Zuckerberg claims he's being stalked by a man who's been sending him creepy messages through Facebook and threatening his safety ... TMZ has learned.

Zuckerberg has obtained a restraining order against 31-year-old Pradeep Manukonda -- after Mark filed legal papers claiming the guy has tried to "follow, surveil and contact Mr. Zuckerberg using language threatening his personal safety" ... and the safety of his girlfriend and his sister.

Law enforcement sources tell us Pradeep had gone to several Facebook offices in Palo Alto attempting to contact Mark to ask for money for his financially-strapped family.

According to the legal docs, Facebook security also intercepted Pradeep at Mark's home on January 24 just as he was about to walk up the front steps.

Cops gave Pradeep a verbal warning -- but Mark claims the guy has continued to try to contact him through the mail ... even sending flowers to his home with a hand-written letter on January 28.

In one of his Facebook messages to Mark, Pradeep writes, "please help me, then I am ready to die for you." He continues, "Please understand my pain."