Martin Odegaard came up with a potentially precious strike as Real Sociedad toiled against Mirandes but claimed a first-leg lead.
Real Sociedad scraped past second-tier Mirandes at Anoeta on Thursday to claim a narrow 2-1 first-leg advantage in their Copa del Rey semi-final.
La Real stunned Real Madrid at the Santiago Bernabeu in the previous round, but Mirandes had knocked out three LaLiga teams en route to the last four and caused concern for top-flight opposition once more.
Captain Mikel Oyarzabal dispatched a ninth-minute spot-kick for Sociedad, yet they were pegged back by Matheus Aias and scarcely deserved the second Martin Odegaard lashed in to restore their lead before the interval.