The Bayern Munich full-back damaged his ankle after an awkward fall during the 4-0 International Champions Cup defeat to AC Milan on Saturday.
The Spaniard is now expected to be sidelined for up to two months.
A statement from the Bundesliga champions read: “Juan Bernat was operated on successfully on his ankle on Monday morning in Munich by Prof. Dr. Markus Walther.
“The 24-year-old Spaniard was injured in the game against AC Milan last Saturday in the 31st minute and then travelled back to Munich.
“There, the initial diagnosis was confirmed after a thorough examination: a tear in the syndesmosis in the left ankle.”
The player Tweeted a picture of himself in recovery from his hospital bed alongside a message of thanks to all those who had offered him support.