A man has been charged over the alleged supply of muffins containing cannabis to high school students in the New South Wales Hunter region.

Police say the 19-year-old sold the muffins to students at a school in Toronto last Monday.

Two students became ill and were taken to John Hunter Hospital for treatment.

Police arrested the man on Saturday afternoon and charged him with supplying prohibited drugs.

He was granted bail and is due to face Toronto Local Court on July 19.