MIAMI – A South Florida law student was arrested Sunday after selling drugs at the Ultra Music Festival and attacking a security guard, police said.

Hector Acosta, 24, was taken into custody Sunday and charged with battery, trespassing, and possession of a controlled substance with the intent to sell.

According to police, Acosta sold MDMA pills during Ultra weekend.

Acosta, who is a law student at St. Thomas University, appeared in bond court Monday. He was released on house arrest and is only allowed to leave to go to school.

Follow Local 10 News on Twitter @WPLGLocal10