A school resource officer and deputy with the Pinellas County Sheriff’s Office retired Tuesday amid allegations that he sexually harassed a female employee at Carwise Middle School while on duty.The Sheriff’s Office received a letter on Oct. 1, which detailed two incidents alleged to have happened in September between the employee and Deputy Bernard D’Agostino, 52. He opted to retire when the agency opened an investigation and informed him he would be assigned to regular patrol duty, the Sheriff’s Office said.The first incident happened on Sept. 17, the letter said, when D’Agostino allegedly walked up behind the employee, placing his hands on her hips without her permission. On Sept. 26, the deputy walked up behind the same woman, who alleged in the letter that he compared a banana, which he offered to her, to male genitals.READ THE GRADEBOOK: The talk of Florida education"Deputy D’Agostino then asked the school employee if she would like a ‘bent one or a straight one,’ insinuating the bananas were (genitals)," the Sheriff’s Office said. "After making the statement, Deputy D’Agostino laughed and continued to make inappropriate comments to the school employee, while handing her the banana."The allegations were confirmed by witnesses, the Sheriff’s Office said, adding that D’Agostino was immediately removed from his post at the Palm Harbor school when the letter was received.The letter arrived on the 20th anniversary of the day D’Agostino was hired by the Sheriff’s Office.In interviews with investigators, the deputy said he could not remember the first alleged incident. He admitted the second, but said he did not intend to compare the fruit to genitals, the Sheriff’s Office said.The agency could not immediately provide information about D’Agostino’s disciplinary history with the Sheriff’s Office. D’Agostino could not immediately be reached for comment.School district spokesperson Lisa Wolf said the district will work with the Sheriff’s Office to find a replacement school resource officer for Carwise.Contact Megan Reeves at [email protected] Follow @mareevs.