Asensio ruptured his ACL and external meniscus in a blow to Madrid's season in the International Champions Cup clash with Arsenal last month.
The 23-year-old suffered the injury after coming on as a second-half substitute in Madrid's penalty shoot-out victory at FedExField in Maryland.
"The operation was carried out by doctor Manuel Leyes, under the supervision of the Real Madrid medical services," a Madrid statement read. "Asensio will remain in hospital until he is well enough to be discharged. From that point on, his recovery program will begin."
Asensio medical report.#RealMadrid— Real Madrid C.F. 🇬🇧🇺🇸 (@realmadriden) August 7, 2019
While Asensio had surgery on Wednesday, Madrid continued their LaLiga preparations with a 1-0 win over Salzburg.
Eden Hazard scored the only goal of the match as he opened his account for Madrid after arriving from Premier League side Chelsea.
Madrid – who finished third in LaLiga last season – will face Roma on Sunday before opening their 2019-20 campaign away to Celta Vigo on August 17.
Reflecting on the match, Madrid head coach Zinedine Zidane said: "I'm really pleased. We put in a good performance, that's why we came here. We're going to do great things this season and now it's important to carry on with our pre-season preparation because there's still another game before LaLiga kicks off. We're gradually getting ready and we're better every day. That was confirmed by today's match.
"I value the team's efforts because it's not easy and it was important to put on a display like this against a tough side. There are no small teams. If you're not focused, any team can make life difficult.
"We were disciplined and showed intensity. We struggled a bit more in the second half but we're happy to have won the game."
"I'm pleased because ultimately all a coach wants is to have all his players available," Zidane added. "There's still one more game before LaLiga and we want to be in great shape in order to compete. If we compete well, we'll achieve great things."