Aston Villa came from behind to beat Litex Lovech 3-1 in a UEFA Cup first round first round leg clash which ended with the Bulgarian side being reduced to nine men.
However, it was an unconvincing display by Martin O'Neill's side, particularly in the first period, and they were extremely fortunate to be level at half-time.
But their Bulgarian hosts imploded in the second half conceding a penalty that Gareth Barry converted and having two men dismissed.
O'Neill opted to give full debuts to Carlos Cuellar and James Milner against a Litex outfit that finished fourth in the Bulgarian League last term and beat Israeli side Kiryat Shmona in the second qualifying round to reach this stage of the competition.
Villa made a very slow start to the game and conceded a sloppy goal after only ten minutes.
Bulgaria international Ivelin Popov curled a free-kick in to the penalty area which evaded everyone, including a stranded Brad Friedel, as the ball ended up in the back of the net.
For a while Villa were all at sea and the Bulgarians threatened to double their lead before O'Neill's side slowly started to get a grip on the game.
Barry thought he had headed home a 25th-minute equaliser from Milner's cross only for the England midfielder to be flagged for offside.
Back came Litex and Carlos Tome Dudu forced Friedel to make a smart 32nd-minute save as the hosts continued to threaten.
Litex almost added a second goal just before the break when Uelingtom Da Silva Tom lifted a free-kick narrowly over Friedel's crossbar before Popov sent Willfred Niflor free. He rounded Friedel but, from a tight angle, could only find the side-netting.
However, in the last seconds of stoppage time Villa equalised. Plamen Nikolov and Litex keeper Urosh Golubovich left the ball to each other on the edge of the area allowing Nigel Reo-Coker to slide a shot into the empty net.
Villa continued to stutter in the second half even after Cedric Kambon had been sent off for a second bookable offence on the hour mark.
However, they took the lead when Mihail Venkov handled the ball on the line and, after he had been dismissed, Barry blasted the spot-kick home.
Stiliyan Petrov added a third goal in stoppage time against a bedraggled Litex side, and are now overwhelming favourites to reach the group stage of the competition.