Kevin-Prince Boateng scored twice for AC Milan as they survived a stern test from PSV Eindhoven's young team to reach the Champions League group stage.
Mario Balotelli also struck his first European goal for Milan in a flattering 3-0 second-leg win which took them through 4-1 on aggregate in the qualifying tie.
PSV nearly went ahead in the eighth minute when Tim Matavz's header was clawed away by goalkeeper Christian Abbiati and Milan took the lead with a low 25-metre shot from Boateng one minute later.
Abbiati made another important save to turn away Adam Maher's 30-metre volley and the visitors had two more chances just before halftime as Jetro Willems' looping cross hit the crossbar before Abbiati scrambled away another Matavz effort.
In between, Milan forward Stephan El Shaarawy rifled a shot against the underside of the crossbar before the ball bounced back into play.
Balotelli, Cup-tied from Milan's Champions League matches last season after his move from Manchester City in January, made the game safe in the 55th minute, diverting Philippe Mexes's flick into the roof of the net from close range.
PSV continued to play good football, only for Boateng to power into the penalty area and add a third with an angled shot in the 77th minute.
Real Sociedad safely made it through to the group stage for the first time since 2003-04, their only previous appearance.
The Spanish side secured an impressive 2-0 win at Lyon in the first leg and Carlos Vela's brace secured the same result in San Sebastian.
Having beaten Maribor 3-1 in the first leg, Stanislav Tecl's third-minute goal at the Stadion Ljudski vrt was enough to ease Viktoria Plzen through 4-1 on aggregate.
In the evening's early kick-off, Zenit St Petersburg beat Champions League debutants Pacos Ferreira 4-2 to secure safe progress.
The Russian side won the first leg 4-1 in Portugal and never looked in any danger, especially after Danny goals either side of half-time.
Aleksandr Bukharov further extended Zenit's lead, before Manuel Jose and Carlao struck either side of an Andrey Arshavin penalty as the tie ended 8-3 on aggregate.