Real had been heavily linked with a number of potential managerial appointments following the shock resignation of Zinedine Zidane, including Tottenham boss Mauricio Pochettino and former Spurs and Porto manager Andre Villas-Boas.
However, they have now made a decision to appoint Lopetegui, who signed a new two-year extension with the Spanish Football Federation (RFEF) last month.
Trump and North Korea’s Kim share historic handshake as summit begins
It's so far unclear whether the USA and North Korea will release some kind of joint statement or agreement following the sit-down. The two clasped hands for a long while Tuesday as they posed for photos in front of a row of USA and North Korean flags.
The search to replace Zinedine Zidane, who left after guiding Real to a third-straight Champions League title, lasted nearly two weeks, with Mauricio Pochettino, Antonio Conte and Jurgen Klopp among the names reportedly in the frame.
In an official statement on the club's website, it was confirmed that the current Spain manager will replace Zinedine Zidane as first team coach after the tournament in Russian Federation.
The 51-year-old, who has been in charge of the national team for the past two years, has agreed a three-year contract at the Bernabeu.
United Nations in 'intense negotiations' to avert attack on Hudeida
Three civilians have been killed when a Houthi missile fired from Yemen hit the town of Jizan, in southern Saudi Arabia.
Real Madrid have appointed the current Spanish national team coach, Julen Lopetegui, as their next coach. Spain will face Iran and Morocco in Group B after the challenge of Cristiano Ronaldo's Portugal in their opener on Friday.
He left Porto to be appointed Spain manager in 2016, taking over from Vicente del Bosque, and will guide them at the upcoming World Cup in Russian Federation.
Lopetegui is now preparing to lead Spain at the World Cup but the 51-year-old will depart his role as national team coach at the end of the tournament.
Liveblog: President Trump Meets North Korean Leader Kim Jong
Kim smiled as he took a selfie with Singapore's Foreign Minister Vivian Balakrishnan at the scenic waterfront Gardens by the Bay. Mr Lee, it said, complimented "the bold and admirable decision" by Mr Kim and Mr Trump to come together for the summit.