Gianluca Scamacca scored his first West Ham goal as they beat Danish side Viborg in their Europa Conference League play-off first leg at London Stadium.
The Italy forward, a £30.5m signing from Sassuolo, was handed his first start and took just 24 minutes to make an impact when he headed in following neat play on the left from fellow new arrival Maxwel Cornet.
It set the hosts on their way to a welcome first victory this season, having lost their opening two Premier League games without scoring a goal.
Jarrod Bowen zipped a second into the bottom corner from distance with 26 minutes to go but the visitors hit back immediately through Jakob Bonde's header.
That threatened to make life uncomfortable for the Hammers until substitutes Said Benrahma and Michail Antonio combined for the latter to tap into an empty net and secure a healthy advantage going into the second leg.
That game will take place in Viborg next Thursday, with the winners joining the group stage of the competition when it begins on 8 September.
Scamacca gets Hammers off the mark
It's been a testing start to the new campaign for West Ham, with an opening-day defeat by champions Manchester City followed by another against newcomers Nottingham Forest.
But they got up and running in Europe's third-tier competition thanks largely to some fresh faces at London Stadium.
West Ham, without captain Declan Rice and vice-captain Aaron Cresswell - and with boss David Moyes banned too - following a heated Europa League semi-final exit last season, handed a debut to defender Thilo Kehrer and first starts to Cornet and Scamacca.
It was the Italian, signed after scoring 16 goals in 36 games for Sassuolo in Serie A last season, who met Cornet's cross with a smart header after good work from the former Burnley man to open the scoring in an otherwise quiet first half.
With Billy McKinlay taking charge in his absence, manager Moyes watched from the stands and was seen handing bits of paper to another of his first-team coaches, Kevin Nolan - Uefa's regulations say there should be no communication with technical staff during the match.
Last season's standout performer Bowen looked to have put the Hammers in control of the tie with a well-placed long-range effort but Viborg showed resilience and pulled one back through Bonde's back-post header.
It was only last year they were playing in the Danish second tier, winning that division in 2021, finishing seventh in the top flight and reaching this stage of the competition thanks to wins over Lithuania's Suduva and Faroe Islands side B36.
They were missing two players who scored in that run, in Nigerian winger Ibrahim Said and Gambia forward Alassana Jatta - unable to travel because of entry rules for non-EU citizens post Brexit - and West Ham's greater depth told late on.
Benrahma's clever footwork saw him surge into the box on the left, before picking out Antonio for a simple finish 12 minutes from time that will give the Hammers breathing space heading into next week's return leg.
Line-ups
West Ham
Formation 4-2-3-1
13Areola
50Ashby2Johnson21Ogbonna5Coufal
32Coventry28Soucek
20Bowen10Lanzini14Cornet
7Scamacca
13Areola50Ashby2Johnson21OgbonnaSubstituted forKehrerat 66'minutes5Coufal32CoventrySubstituted forDownesat 84'minutes28Soucek20BowenSubstituted forBenrahmaat 66'minutes10LanziniSubstituted forFornalsat 45'minutes14Cornet7ScamaccaSubstituted forAntonioat 67'minutesSubstitutes
4Zouma8Fornals9Antonio12Downes22Benrahma24Kehrer25Trott35Randolph40Oko-Flex46Ekwah48Baptiste51ChestersViborg FF
Formation 4-3-3
1Lund
24Anyembe4Bürgy5Zaletel7Sørensen
17Bonde13Grønning14Leemans
19Zamburek11Grot8Lonwijk
1Lund24AnyembeSubstituted forGaaeiat 34'minutes4Bürgy5Zaletel7Sørensen17BondeSubstituted forThorsenat 87'minutes13Grønning14LeemansSubstituted forSøndergaardat 66'minutesBooked at 68mins19ZamburekSubstituted forBergerat 87'minutes11Grot8LonwijkSubstituted forMortimerat 66'minutesSubstitutes
2Gaaei3Lauritsen6Søndergaard10Mortimer18Thorsen20Kiilerich21BergerLive Text
Match ends, West Ham United 3, Viborg FF 1.
Second Half ends, West Ham United 3, Viborg FF 1.
Hand ball by Tomás Soucek (West Ham United).
Corner, Viborg FF. Conceded by Michail Antonio.
Attempt blocked. Jonas Thorsen (Viborg FF) right footed shot from the centre of the box is blocked. Assisted by Zan Zaletel.
Foul by Thilo Kehrer (West Ham United).
Jay-Roy Grot (Viborg FF) wins a free kick in the attacking half.
Maxwel Cornet (West Ham United) wins a free kick in the defensive half.
Foul by Mads Søndergaard (Viborg FF).
Attempt blocked. Nils Mortimer (Viborg FF) left footed shot from the right side of the box is blocked. Assisted by Sofus Berger with a cross.
Substitution, Viborg FF. Jonas Thorsen replaces Jakob Bonde.
Substitution, Viborg FF. Sofus Berger replaces Jan Zamburek.
Hand ball by Nils Mortimer (Viborg FF).
Substitution, West Ham United. Flynn Downes replaces Conor Coventry.
Corner, West Ham United. Conceded by Christian Sørensen.
Corner, West Ham United. Conceded by Anton Gaaei.
Attempt blocked. Maxwel Cornet (West Ham United) left footed shot from the right side of the six yard box is blocked. Assisted by Pablo Fornals.
Corner, West Ham United. Conceded by Anton Gaaei.
Attempt saved. Maxwel Cornet (West Ham United) left footed shot from the right side of the box is saved in the top centre of the goal. Assisted by Vladimír Coufal with a cross.
Goal! West Ham United 3, Viborg FF 1. Michail Antonio (West Ham United) left footed shot from very close range to the bottom left corner. Assisted by Saïd Benrahma.