SAN JOSE (CBS SF) — A San Jose man pleaded guilty in federal court on Wednesday to a charge of impersonating a federal officer when he pulled over a driver in 2018 and told her he was a U.S. Drug Enforcement Administration agent.

Alexander Taylor, 49, entered the plea before U.S. District Judge Lucy Koh in San Jose and will be sentenced by her on May 27. The conviction carries a potential sentence of up to three years in prison.

READ MORE: UPDATE: 1st U.S. Case Of COVID Omicron Variant Confirmed In San Francisco

A man identified by the Drug Enforcement Administration as 49-year-old Alex Taylor is seen wearing a gold DEA-style badge around his neck outside a home on Hatfield Walkway in San Jose on Friday, March 1, 2019. (U.S. Department of Justice)

According to a federal criminal complaint filed against Taylor last March, Taylor pulled over a driver in San Jose on Dec. 24, 2018, by using flashing emergency lights on his Volkswagen sedan.

READ MORE: Trevor Noah To Host 'The 64th Annual GRAMMY Awards' On CBS

A man later identified as Taylor then approached the driver, wearing a gold-colored badge and telling her he was a DEA agent. He asked where she was going in a hurry.

The driver happened to be an off-duty U.S. Department of Transportation agent on her way to Mass. When she told him that DEA agents don’t write traffic tickets and that she was a federal agent, he returned to his vehicle, did a U-turn and drove away, according to the complaint.

MORE NEWS: 'Video Music Box' Founder, Hip Hop Influencer Ralph McDaniels Shares His Journey In New Showtime Documentary: 'This Music Is Really Powerful'

As part of the plea bargain, prosecutors will drop an additional charge that Taylor possessed a counterfeit badge of a U.S. agent. U.S.  Attorney’s Office spokesman Robin Wall said Taylor admitted during his plea that he bought the counterfeit DEA badge on the Internet.