A staff masseur at Google’s Manhattan headquarters is suing the search engine giant, saying he was fired for complaining that a company engineer pleasured himself during a workplace rubdown.

Elvis Gardin, of Edison, N.J., claims in his federal court suit that he “was the subject of sexual harassment and unwanted sexual advances by a Google engineer who, among other things, engaged in masturbation during a massage session at the New York office.”

Gardin claims that Google supervisors did nothing to curb the behavior after he lodged formal complaints, according to the suit, filed in New Jersey.

Trained in classical Swedish massage techniques, Gardin claims that he was fired in 2011 because of “false and malicious write-ups” that followed his complaint, while he was on a leave of absence to tend to his sick mother.

The poor evaluations were a pretext to boot him from the office because he took on the engineer, the suit claims.

Reached at his home, Gardin declined to comment. His attorney, Andrew Clark, also declined comment.

Gardin states in the suit that he was first hired to knead weary Google staffers in 2008 and never had a negative evaluation before he complained about the unnamed engineer’s allegedly lewd behavior.

In addition to Google, the suits names two supervisors as defendants — Michelle Hocking and Jenny Byrn Guinan — claiming they failed to act after his initial complaints about his tormentor.

He also notes that he is openly gay and that the masseur who replaced him was heterosexual.

Gardin is seeking unspecified damages for back pay, citing harassment, retaliation and violation of the Family Medical Leave Act.

The masseur is also demanding that Google provide fair evaluations of his performance at the company to aid him in future job applications, court papers state.

Google did not respond to a request for comment on the suit.

The thriving tech giant is known to provide lavish amenities for staffers from haircuts to pool and air hockey tables in employee lounges.