Stanford University today dismissed a computer science instructor who had advocated drug use and boasted of carrying drugs in his backpack while on campus.

The university said it took the action because the instructor, Stuart T. Reges, had violated university policies on drugs and alcohol and refused to comply with policies in the future. In particular, Stanford officials said, Mr. Reges had confirmed that he had carried illegal drugs on campus and had paid for alcoholic beverages for students under the age of 21 at a university function.

Stanford had been warned last month by Bob Martinez, Director of the Office of National Drug Control Policy, that it risked losing Federal financing if it did not comply with federally imposed anti-drug policies. Mr. Martinez's warning came after Mr. Reges sent a letter to the agency criticizing the Federal anti-drug policies.

Late last month, Stanford placed Mr. Reges on paid leave and began an investigation that led to today's action.