Ronald Matarrita will be out of action for NYCFC and the Costa Rican national team for a while. (Photo courtesy of MLS)

Ronald Matarrita will be sidelined from three to four months.

The New York City FC and Costa Rican international defender Friday underwent surgery on his right fifth metatarsal this morning at NewYork-Presbyterian Columbia University Medical Center.

The operation was termed a success by NYCFC.

Matarrita suffered the fracture early in City’s 3-1 win over Minnesota United at Yankee Stadium Thursday night.

Mikey Lopez replaced him in the ninth minute and acquitted himself well.

“Everyone at the club will be supporting Ronald and is looking forward to having him join us back on the field once he is ready,” head coach Patrick Vieira said in a statement. “He is a fantastic professional and we know he will work exceptionally hard with our medical team to come back fitter and stronger than ever.”