Scott Evans, a former soap opera star arrested last month, has pleaded guilty in a Los Angeles court to attempted possession of cocaine, officials said.

The brother of "Captain America" actor Chris Evans was arrested last month after he allegedly tried to buy cocaine from an undercover police officer.

TMZ said Monday Scott Evans originally pleaded not guilty to the attempted possession charge, but changed his plea to guilty in exchange for the option of no jail time.

As part of his plea deal, the onetime "One Life to Live" star agreed to attend 60 Narcotics Anonymous meetings. If he completes his side of the bargain within six months and stays out of trouble, the charge will be dropped, TMZ said.

"One Life to Live" was canceled in 2011, but producers recently announced a version of the daytime drama will be revived online. It is unclear whether Evans will return to the show.