Two men are facing charges after MBTA Transit Police detectives allegedly witnessed them engage in a drug deal while riding an inbound Red Line train near South Station Thursday afternoon.

Anthony Cogliano, 40, of Everett is facing charges of distributing drugs and drug possession.

John Burgoon, 25, of Dorchester is facing charges of drug possession.

Advertisement - Continue Reading Below

Burgoon pleaded not guilty in Boston Municipal Court and was released on personal recognizance. He is scheduled to return for a pretrial hearing on Feb. 24.

Cogliano is also expected to be arraigned in Boston Municipal Court.

Transit Police detectives allegedly observed the transaction as the train approached South Station just before 4 p.m.

Detectives witnessed Cogliano and Burgoon make a “hand to hand transaction” of an amphetamine, the statement said.