Dundalk are through to the second round of the Champions League qualifiers.
They beat Riga 5-4 on penalties after their second leg in Latvia finished scoreless after extra time.
It meant the tie was level at 0-0 on aggregate after more than three-and-a-half hours of football.
Gary Rodgers saved two spot-kicks in the sudden death period before Sean Hoare scored the final penalty to send them through.
Stefan Panic and Armands Petersons were denied by the 37-year-old before Hoare settled the shootout.
Herdi Prenga was also sent off for Riga in extra time after a forgettable 90 minutes.
Roman Debelko missed a good chance in extra time and Prenga was dismissed before the game was decided by penalties.
Felip Brisola missed for the hosts and Dane Massey and Georgie Kelly failed to convert for Dundalk.
But Rodgers' saves from 12 yards and Hoare's strike sent Vinny Perth's side through.
They will face Qarabag in the second qualifying round.