EXCLUSIVE

Terrence Howard has been accused by his ex-wife of beating her badly during a heated argument in Costa Rica ... TMZ has learned.

Michelle Ghent -- who divorced Terrence in May but hooked up with him again recently ... took a trip with Terrence and several of his family members to Costa Rica last week. Sources say an argument erupted and she claims Terrence beat her up.

We've learned Terrence claims Michelle maced him, his adult daughter and another family member. Police were called and reports were taken.

Sources say Terrence made up the mace story to cover his brutality. Other sources connected to Terrence say Michelle is lying about the actor physically abusing her.

We've learned Michelle is going to court in an attempt to get a restraining order ... forcing Terrence to stay clear of her.