Vinicius Junior produced the second-half winner as Real Madrid moved level on points with LaLiga leaders Barcelona after Saturday's 2-1 win over Celta Vigo.
Kylian Mbappe gave Madrid the lead with a brilliant long-range strike in the 20th minute, yet Williot Swedberg equalised for the home side with a first-touch effort from a counter-attack shortly after half-time.
Carlo Ancelotti's side went ahead again when substitute Luka Modric, who became Madrid's oldest player in history, played Vinicius through before the Brazil winger rounded Vicente Guaita to score the winner.
It could have been a different story, however, if not for substitute Tasos Douvikas missing a golden opportunity to level late on.
Madrid held on, though, as victory left the champions second in the LaLiga standings on 24 points, level with leaders Barcelona before their game in hand at home to Sevilla on Sunday.
Data Debrief: Vinicius the hero on Modric's landmark game
Vinicius has been involved in at least one goal in each of his last six LaLiga games (four goals and three assists), his best such run in the competition.
It proved a landmark game for substitute Modric, too, as the Croatia midfielder became Madrid's oldest player in history, aged 39 years and 40 days.
Modric moved past Madrid great Ferenc Puskas for the club record, while the midfielder has been part of 363 wins for Los Blancos, which is 22 more than nearest rival and former team-mate Karim Benzema.
This was his 547th appearance for the LaLiga champions as well, a tally no player can match since his debut for the club in August 2012.