A plea and sentencing proceeding was postponed Monday in Dukes County superior court because of concerns about prescription drugs a defendant was given at the Edgartown house of correction.

Trevor J. Medeiros, 21, was indicted in 2012 on two counts of statutory rape of a child for allegedly having sex with a 13-year-old girl he had been dating at the time.

Mr. Medeiros was in the courthouse Monday to change his plea from not guilty to guilty, he told the Hon. Tina S. Page.

The Cape and Islands assistant district attorney Laura Marshard and Mr. Medeiros’s attorney, Robert Moriarty, came to court prepared with sentencing recommendations.

As is typical for plea proceedings, Judge Page asked Mr. Medeiros a series of questions about his education, employment, and mental state. In response to the questions, Mr. Medeiros said he had never been diagnosed with a mental illness.

But when asked if he takes any medications, Mr. Medeiros said yes: Gabapentin and Zoloft, which he said he is given to him three times a day at the county jail where he has been housed.

Mr. Medeiros said he sometimes signs a refusal form and does not take the medication “because I feel that I don’t need it.”

“Honestly, your honor, I don’t know why I take it,” he said. He said he last took the medications the previous day at 3 p.m. and again at 9 p.m., and he did not take the medications before he was incarcerated.

“This is a lot of medication you are taking, young man,” Judge Page said. She said the fact he was taking the medications made her question whether they had any impact on his decision to plead guilty in the case. She asked Mr. Moriarty whether he thought Mr. Medeiros had any problems understanding questions and if he was confident his client was oriented and understanding.

Mr. Moriarty said he had not been aware Mr. Medeiros was taking medication, but he thought his client understood everything.

“My concern is that your lawyer did not know you were taking these medications,” Ms. Page said. She said she wanted Mr. Medeiros to speak with someone who could gauge whether he was capable of making decisions before the proceeding could continue.

The proceeding was rescheduled for next Monday.

Dukes County Sheriff Michael McCormack told the Gazette later that the Gabapentin is a light pain medication and Zoloft was prescribed for mood swings.

“There’s no question the physician who prescribed the medication would have told him what the medication was for, why he should take it, what the side effects are,” Sheriff McCormack said. “We don’t prescribe medications but we bring people to doctors.”

Sheriff McCormack said that when inmates arrive at the jail, they are given a medical screening to find out if they are taking any medications, and whether they have allergies and health insurance. If they return to the jail after going to court, they are given a second, more in-depth screening by a registered nurse.

If there is a need to continue a medication an inmate is taking, or if an inmate needs to start taking a medication, a physical exam is arranged with a physician or a mental health exam with a psychiatrist, the sheriff said. “They would then prescribe medication if necessary for the inmate,” he said.

He said inmates are called in at certain times of the day to take medications, and the corrections department can’t force them to take medication even if it’s prescribed for them.

“If they don’t want to take it we can’t make them take it,” Sheriff McCormack said, but inmates are required to sign a refusal form.